I would like some help with regex.
I\'m trying to create an expression that will include certain strings and exclude certain strings.
For example:
I
To match a string which must have word from a set of words you can use positive lookahead as:
^(?=.*(?:inc1|inc2|...))
To not match a string which has a word from a list of stop words you can use negative lookahead as:
^(?!.*(?:ex1|ex2|...))
You can combine the above two requirements in single regex as:
^(?=.*(?:inc1|inc2|...))(?!.*(?:ex1|ex2|...))REGEX_TO_MATCH_URL$
Rubular link