My pattern is
^[a-z0-9][a-z0-9\-_.]*[a-z0-9\-_]$
I want to exclude one or more consecutive periods.
1.1.1.1 -----> GOOD
1..1.1.1 ------> BAD
Thank you for your help.
My pattern is
^[a-z0-9][a-z0-9\-_.]*[a-z0-9\-_]$
I want to exclude one or more consecutive periods.
1.1.1.1 -----> GOOD
1..1.1.1 ------> BAD
Thank you for your help.
If just want to avoid any occurrence of dots being adjacent to each other, try the word boundary meta escape \b
.
/\b[.]\b/g