I am new to regex use in Java. I want to validate the input in the text box.
The input in the text box can start with any lowercase alphabet.
But it should not start with dm e.g. dmemployee. Whereas mdemployee will work.
The first character d can be followed by either digit or lowercase character (except m).
Please suggest a regex for this.
Thanks!
What you are looking for is a negative lookahead. Also, your description is a bit confusing. Can this be all numbers and lowercase letters or only lowercase letters with
dbeing allowed to be followed by numbers?This regex assumes any mix of lowercase letters and numbers (disallowing
dm)Ah perfect. The other answer here would be if numbers can only follow an initial
d