I’m looking for a way to search a string into a big set, but without considering strings that contain a certain sequence of chars.
For example:
The original set is:
proc-smile
func-get-aaa
func-get-smile
func-has-ccc
func-has-ddd
func-hello-bye
func-cheers-hey
func-smile-lol
If the user search for “sm”, the regex must consider only the subset composed by strings that don’t contain “-get-” or “-has-” substrings. Hence, result must be:
proc-smile
func-smile-lol
(without func-get-smile)
Thanks for the help
will match strings that contain
smbut don’t have either-get-or-has-in them.(?!...)is a negative lookahead assertion.