I have a Regex to allow alphanumeric, underscore and dots but not consecutive dots:
^(?!.*?[.]{2})[a-zA-Z0-9_.]+$
I also need to now allow
You can try this:
^(?!.*\.\.)[A-Za-z0-9_.]+$
This will not allow any consecutive dots in the string and will also allow dot as first and last character
Tried here