I am using node with mongodb and trying to search a particular string.In db there is a string named "xyz limited (xy)" . if i am using the below regular expression-
.*+xyz limited (xy)+.*
i am unable to find any match but if i use
.*+xyz limited+.*
I got one result. Even if i am searching like .*+(xy)+.*
I got one result but for entire string "xyz limited (xy)" no match found.
Asked
Active
Viewed 13 times
0

Rohit Raj
- 33
- 2
- 7
-
Escape the `(` and `)` to match literal parentheses. – Wiktor Stribiżew Nov 07 '17 at 07:45
-
thanks a lot .. it works fine – Rohit Raj Nov 07 '17 at 07:56