typhoonmentat has asked for the wisdom of the Perl Monks concerning the following question:
Monks, how would I go about matching a character already matched a second time? For instance, the code:
/^.+?\w{2}
can match any two alphanumeric characters, but what if I want to match "aa" or "bb" or "zz"? I'm really looking for some code that will match when a word has three double-letter pairs in it, like "hullaballoo".
Thanks, Rob
demerphq editted, changed pre content to normal html
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Repeated character in regex
by bart (Canon) on Mar 19, 2005 at 11:54 UTC | |
|
Re: Repeated character in regex
by holli (Abbot) on Mar 19, 2005 at 11:53 UTC | |
|
Re: Repeated character in regex
by ysth (Canon) on Mar 21, 2005 at 04:26 UTC | |
|
Re: Repeated character in regex
by tphyahoo (Vicar) on Mar 21, 2005 at 13:47 UTC |