Or in regular expression unable to use in search
-
Hi,
I am unable to use | in regular expression while searching two string ie (string 1|string 2)in search…does any one know why it’s not coming ?? -
It works fine.
For anybody to say what is going wrong for you, you’d have to present some data and a search regex.
We’re not mind-readers here. -
- in find I am giving regex as (dog | cat)
2.opted for regular expression
3.selecting find all in current document
4.in search result getting 0 matches
But dog and cat are present in my text file
- in find I am giving regex as (dog | cat)
-
Hard to tell what you are REALLY doing from that.
It appears you have extra space characters in there maybe?
Maybe you have(dog | cat)instead of(dog|cat)?
Spaces ARE significant in regular expressions, unless you use the(?x)option in front, e.g.(?x)(dog | cat)Anyway, alternation (the
|regex operator) definitely works fine:
I dropped the wrapping parentheses for the example, but it works just as well with them as without them.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login