I want to validate a string with alpha numeric values, but if the string contains -- (double dash) anywhere in the string, it should be invalid.
valid:
apple123-apple-123app-le123a-p-p-l-e-1-2-3
invalid:
--apple123app--le123
https://stackoverflow.com/a/1240365/1920590
The above old post have the answer ^(?!.*bar).*$ which does the negation, but it does not work for same character repetition like --.
Can anyone help me to figure out to modify the ^(?!.*bar).*$ to identify -- as a string.