I want to match all occurrences of ABC that are not preceded by db_
xyzABC will match
xyzdb_ABC won't match
i tried
*(!db_)ABC
but it still matches.
please help find my mistake
thanks!
Regular Expressions
Last Comment
willsherwood
8/22/2022 - Mon
Marco Gasi
Use this:
(?<!=db_)\w+
it_saige
/(db_ABC)+|ABC+/g will provide all matches of db_ABC in group 1 and all matches of ABC in group 0.
-saige-
willsherwood
ASKER
sorry for the confusion.
ABC is exact literal text (not meta placeholder text for my example)
i don't want to match ABC when the ABC identifier is directly preceded by db_
is there an online Regex tester (i found several that are installable programs, but none that
one can enter a searchstring and a sample text to search/replace)
(i'm wondering if it's a bug in the particular implementation of regex in the tool i'm using? )
In the suggested tester the regex works without the parameter to Ignore PatternWhiteSpace required by my tester. So it seems work the regex suggested in my post ID: 40692307. I'm a bit confused about the reason one tester require some additiona parameter and other don't... Anyway, good link, @saige :)
willsherwood
ASKER
aha! excellent,
it's evidently a bug in the regex engine for the tool i'm using!
THANK YOU
(?<!db_)SingleFieldQuery works to differentiate the two test cases!
(?<!=db_)\w+