I need help finding a regular expression to match all digit sequences which has no repeated digit. Example:
198345 -> matched.
198315 -> not matched (1 repeated twice )
How can I achieve this in
If you need to do it with regex, see Stephane's wonderful answer to a similar question.
If regex is not a must, I offer you a Perl alternative:
Interesting question. Thank you. The answer I found a little bit creepy:
pattern find the occurrence of digit
Below the same numbers must appear consecutively: they match 1123456 (consecutive 1s) but not 1213456 (non-consecutive 1s):
A lame solution is this:
A more compact but still lame way is this: