[pcre-dev] [Bug 1393] the opposite of a reference

Página Principal
Apagar esta mensagem
Autor: Philip Hazel
Data:  
Para: pcre-dev
Assunto: [pcre-dev] [Bug 1393] the opposite of a reference
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1393




--- Comment #4 from Philip Hazel <ph10@???> 2013-10-08 18:51:35 ---
On Tue, 8 Oct 2013, ouadji wrote:

> (3)(?!\1) ... matches 3 from input string a3bc
> the term (?!\1) is just a conditional term,
> but (?!\1)is not included in the match.
> The good résult would be 3b.


The ... in my pattern was part of the pattern! So you need

(3)(?!\1).
         ^
         ^
      This matches the character.


I realized this isn't quite as simple. And it won't work if the group
has a variable number of characters.

> "Nothing like you suggest exists in Perl ..."
>
> I suspected a answer like this one. I understand, but it's a pity.


Even more unlikely is the introduction of a new meta-character like the
~ you suggest. It would break many patterns.

> but like you say, if nothing like i suggest exists in Perl
> ... then this is a dead end. :-)


Perl does keep changing ... I try to keep up with it. So you never know.

Regards,
Philip


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email