Reputation: 266
I'm looking to create a REGEX that causes a match on the following criteria
My knowledge is quite limited on this!
I've tried to set up my own and can get a match on either, but not both?
/(^[.])|(\b([.][.])) /gm
Any help would be much appreciated!
The expected outcome is
phrase = pass
.phrase = fail
ph..rase = fail
..phrase = fail
Upvotes: 0
Views: 20
Reputation: 18357
You can use this regex, which will fail the match if the very first character is a literal dot or two literal dots are present anywhere in the text,
^(?!.*\.\.|\.).*$
Upvotes: 1