I need a regex which matches all alpha numeric chars and zero or one '@' symbol in any part of the string, so:-
Ab01@ - match
Ab0@1 - match
@Ab01 - match
here's what I have:-
/^[A-Za-z0-9]+@{0,1}$/
The above matches the '@' when it's at the end of the string but doesn't match when it's at the start or in the middle, for example
@Ab01 - no match
Ab@01 - no match
I've tried removing the ^ & $ indicating start and end of the expression - but this allows more than one match of the @ which is not what I want.