Hello,
Say there are six strings
- "abcd bbb ccc"
- "abce bbb ccc"
"abcf bbb ccc"
"aaa abcd ccc"
- "aaa abce ccc"
- "aaa abcf ccc"
User enters expression "<abc[!e]
"
This expression gets translated into following regex "^abc[^e]"
Translated regex would successfully match strings 1 and 3
If I wanted to match strings 4 and 6 the expression has to be translated into "\Wabc[^e]" (this would also match space before abc chars :(, which is not good)
Unfortunately user entered expression needs to be converted in regex that would match both 1,3 and 4,6 strings.
Is there way to translate user entered expression into regex that would combine "^abc[^e]" and "\Wabc[^e]" expressions (ideally second expression would not match first space :) )