Regex for at least one alphabet and shouldn't allow dot(.) -
i have written regex below i'm facing issue:
^[^\.]*[a-za-z]+$ as per above regex, df45543 invalid, want allow such string. 1 alphabet character mandatory , dot not allowed. other characters allowed.
you need use lookahead enforce 1 alphabet:
^(?=.*?[a-za-z])[^.]+$ (?=.*?[a-za-z]) positive lookahead makes sure there @ least 1 alphabet in input.
Comments
Post a Comment