I need to write regex(.NET) that match string:
start with a letter, can contain letters, numbers, periods, hyphens, 1 underscore and follow ‘@’. I tried the follow one, but it doesn’t match ‘a_bc12@’ for example.
How to fix it?
^[A-Za-z][A-Za-z0-9-]+_{0,1}(?=@)
EDITED:
it should contain {3,10} length.
You will need to allow characters after the underscore again:
Also, I’ve added the periods and made the strings before and after the underscore optional.