Regex to match 'product' but not 'production' or 'products'? -
this question has answer here:
- regex.match whole words 4 answers
is there way can write regular expression matches 'product' not 'production' or 'products'?
the input string 'oil production', or 'production', or 'products'.
i'm pretty sure you're looking "negative lookahead": product(?!s|ion)
match product, if it's followed s
or ion
ignore , keep looking.
Comments
Post a Comment