regex word boundary not working correctly atom
Answers
Answered by
0
Hey..!
They are the same pattern repeated once, twice and three times. When I search for test with Whole Word enabled on the first file, the first line is found. When I search for ======= with Whole Word enabled on the second file, no matches are found.
Underneath the covers, Whole Word is implemented as wrapping the search text in \b tokens and performing a regular expression search. Since \b matches "word" boundaries, in other words the transition from word to not-word and vice versa, that is why it is failing your expectations here. There is no transition to or from a word to match against.
As a workaround, you could use something similar for your purposes:
Set the Find text to: [^=]=======[^=]
Disable Whole Word
Enable Regular Expressions
Execute the search
This should match your expectations.
@bipasha
They are the same pattern repeated once, twice and three times. When I search for test with Whole Word enabled on the first file, the first line is found. When I search for ======= with Whole Word enabled on the second file, no matches are found.
Underneath the covers, Whole Word is implemented as wrapping the search text in \b tokens and performing a regular expression search. Since \b matches "word" boundaries, in other words the transition from word to not-word and vice versa, that is why it is failing your expectations here. There is no transition to or from a word to match against.
As a workaround, you could use something similar for your purposes:
Set the Find text to: [^=]=======[^=]
Disable Whole Word
Enable Regular Expressions
Execute the search
This should match your expectations.
@bipasha
Similar questions
Business Studies,
8 months ago
English,
8 months ago
Chemistry,
1 year ago
English,
1 year ago
Science,
1 year ago