Skip to content

Instantly share code, notes, and snippets.

@jcsalterego
Created February 15, 2012 15:39
Show Gist options
  • Select an option

  • Save jcsalterego/1836748 to your computer and use it in GitHub Desktop.

Select an option

Save jcsalterego/1836748 to your computer and use it in GitHub Desktop.
> use regex_test;
switched to db regex_test
> db.foo.insert({text:/B[au]d/})
> db.foo.find({text:'Bud'})
> db.foo.find({text:/B[au]d/})
{ "_id" : ObjectId("4f3bd212883c17ef0ece43ad"), "text" : /B[au]d/ }
> db.foo.find({text:/B[ua]d/})
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment