Roy Johnson has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (regular expressions)
The most natural solution is to use lookbehind, starting with the third character, to check that the last three characters are not all the same:
The problem with that is that Perl's regex engine assumes that any backreference is variable-length, and variable-length lookbehinds are not allowed./..(?:(.)(?<!\1\1\1)){1,4}/
Originally posted as a Categorized Question.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I use backrefs in a lookbehind?⭐
by Roy Johnson (Monsignor) on Dec 02, 2004 at 16:00 UTC | |
|
Re: How can I use backrefs in a lookbehind?
by Ieronim (Friar) on Jun 28, 2006 at 21:51 UTC |