Is it possible to make a regular expression so that a certain character can only be used a 2 times throughout the whole string? It doesn't work with quantifiers because those ensure you that a certain character can't be used a certain amount of times in a pattern and not in a whole string.
Thanks in advance!
something like this?
Yes, it's possible. In may ways you can validate that.
Really? How? Because I searched for 2 hours and I didn't find a solution to it :s
You don't want to give a hint perhaps? :-)
Originally Posted by Nimyz
This regexp recognizes at most two x's in a line. If you want exactly two x's remove the question marks.
And also you can test/validate all the regular expressions on Regular Expression Library