I have a regular expression ^[\\p{L}\\d._]*\\p{L}+[\\p{L}\\d._]*$ and this works fine for
ABC123de(alphanumeric – irrespective of the case)ABCDEfgh(only alphabets – irrespective of the case)Abc_.123(only special characters allowed are_and.)
However, it is accepting inputs like
balaji_,jacob_(having_at the end)2balaji,2jacob(starting with a numeric)
Can we modify the above regular expression to restrict the above two test cases?
Sure, add the appropriate restrictions to the beginning and end like this: