I'm trying to write a Regex with these requirements:
- there mustn't be any consecutive characters except from letters and numbers
Example: I'm #1! I feel greaaaat! (OK), I''m kinda .{}. sad (NOT OK)
- there mustn't be more than 4 characters except from letters and numbers
Example: a.a,aaa (OK), a.a,a[]a/ (NOT OK)
I've written this Regex so far, but it seems to be not working properly.
/^(?!.*?[!"#$%&'()*+,-./:;<=>?@[]^_`{|}~]{2})[A-Za-z0-9!"#$%&'()*+,-./:;<=>?@[]^_`{|}~].*$/
Can you suggest any solution? Thanks.