Hello All,
I am new to writing regular expressions and have been trying to write a regex for the following criteria:
Cannot contain ~, #, &, {}, asterisk, {}, \, :, <>, ?, /, +, |, or "
It cannot start with a period or an underscore
Cannot have two consecutive periods
Cannot end in a period
This is what I have thus far:
'^(?!.*\.{2})^[a-zA-Z0-9][a-zA-Z0-9_. ]+[^.]$'
This regex, however, does not produce the desired effects. When removing the appended "[^.]" the regex works as desired other than the fact that it doesn't validate strings ending with a period. Please help me solve this issue of validating strings that end in a period.
Thanks for all your time and help.