Larry Woods said:
I want a regular expression that will return TRUE if there is NOT a
substring in the string. Example: Return true if the substring "image" is
NOT in the string.
That is hard.
It is much easier to return true if the search string is in the string
to be searched. Then use negation to return the opposite:
!(/image/).test(myStr)
If you really insist on a regular expression that matches all strings
without the substring "image", then here are some suggestions:
Using lookahead:
/^((?!image).)*$/
(probably horribly inefficient with all that lookahead)
Brute force:
/^([^i]*)((i[^im]|i$|im[^ia]|im$|ima[^ig]|ima$|imag[^ie]|imag$)[^i]*)*$/
Combination, only do lookahead on an i.
/^([^i]*)((i(?!mage))*[^i]*)*$/
Enjoy
/L