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 use it like this with additional lookaheads:
^(?!\.)(?!.*\.$)(?!.*?\.\.)[a-zA-Z0-9_.]+$
(?!\.)
.
(?!.*?\.\.)
(?!.*\.$)