I was wondering how I can match two numbers, but which do not match. So it would be nice to match 12, but not 11.
What I have so far: I need to match strings like "P12", and I did this with this regular expression:
^P([1-6]{1})([1-6]{1})$
But now my problem is how to match only strings like P12 or P32 where numbers are not repeated.
Any help or guidance for reading materials would be greatly appreciated.
edit: Thanks to everyone for your answers, but I tested this on RAD (radsoftware.com.au/regexdesigner). I know, I should have mentioned this: /, and most of them do not work there. I saw a solution sent from one user, but this is no longer visible, I donβt know why he deleted it? anyway: this is what worked:
^P([1-6]{1})(?!\1)([1-6]{1})$
Thanks everyone!
source share