Regex to match 'product' but not 'production' or 'products'? -


this question has answer here:

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

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -