Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have tried
/([A-Za-z])\1{1}/
but this finds pairs of letters. My intent is to match only paired letters, not singular and not three or more.
"caab" should match
"cdaaadc" should not match
The reason is a puzzle I have been making for personal use. More in the nature of expanding my RE chops than anything else. Please let me know if I can provide more information or if there are any solutions to this. Thank you!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex to match double letters but not triple or more
by hv (Prior) on Aug 15, 2024 at 16:57 UTC | |
|
Re: regex to match double letters but not triple or more
by hippo (Archbishop) on Aug 15, 2024 at 16:44 UTC | |
|
Re: regex to match double letters but not triple or more
by ikegami (Patriarch) on Aug 15, 2024 at 16:18 UTC | |
|
Re: regex to match double letters but not triple or more
by tybalt89 (Monsignor) on Aug 15, 2024 at 21:56 UTC | |
|
Re: regex to match double letters but not triple or more
by LanX (Saint) on Aug 15, 2024 at 21:57 UTC |