in reply to Re: REgular expression to check the string that allows "a","b" and "c" to occur only once in any order.
in thread REgular expression to check the string that allows "a","b" and "c" to occur only once in any order.
Update: Nicely re-worked. Previously it didn't work but now it does. Nice job. I'm leaving my initial response here anyway, but it's no longer pertinent.
That doesn't work because it incorrectly matches invalid strings.
If you change
tomy $str="abc";
You'll still get a match even though that's not supposed to be a valid string. You'll have to go a bit more complicated in the regex to exclude the false hits. Update: I was missing my 2nd code snip.my $str="aaa";
|
|---|