in reply to RegEx to match unique string of digits
GrandFather's suggestion of filter out the false matches afterwards is probably sufficient for you, and perhaps also more efficient (but do a Benchmark to be certain if time efficiency is an issue). However, maybe you need this in a larger pattern, and then you can use a negative look-ahead to avoid the mono-digit strings.
$_ = '2222222222 1234567890 123 0000000000 48192049281924 999999999999 +99'; print "$2\n" while /\b(?!(\d)\1+\b)(\d{10,}\b)/g; __END__ 1234567890 48192049281924
lodin
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: RegEx to match unique string of digits
by simulantx (Initiate) on Jun 05, 2009 at 03:37 UTC | |
by PrestonMB (Initiate) on Jun 05, 2009 at 21:10 UTC |
In Section
Seekers of Perl Wisdom