Can someone help me create a regular expression for an html5 input pattern attribute that excludes specific items?
How can I convert
- ab
- aba
- ba
into a pattern that will match anything that is not exactly one of these words?
For example, I want the following behavior:
- ab - does not match
- abab - matches
- bab - matches
- b - matches
- ab a - matches
In essence, I am looking for the equivalent of the following regex in JavaScript:
! ['ab', 'aba', 'ba'].some(x => x === term)