[pcre-dev] [Bug 2301] Wish: (?w=[class]) modifier redefines …

Top Pagina
Delete this message
Auteur: admin
Datum:  
Aan: pcre-dev
Oude Onderwerpen: [pcre-dev] [Bug 2301] New: Wish: (?w=[class]) modifier redefines word characters for \w \W shorthand and \b \B anchors.
Onderwerp: [pcre-dev] [Bug 2301] Wish: (?w=[class]) modifier redefines word characters for \w \W shorthand and \b \B anchors.
https://bugs.exim.org/show_bug.cgi?id=2301

Mehmet gelisin <mehmetgelisin@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mehmetgelisin@???


--- Comment #6 from Mehmet gelisin <mehmetgelisin@???> ---
Essentially: Remove this restriction from PCRE

      Recursion  processing  in PCRE differs from Perl in two important ways.
       In PCRE (like Python, but unlike Perl), a recursive subpattern call  is
       always treated as an atomic group. That is, once it has matched some of
       the subject string, it is never re-entered, even if it contains untried
       alternatives  and  there  is a subsequent matching failure.
  http://www.compilatori.com/
It leads to unparseable context-sensitive grammars like:


{ S -> 0B1 | 1B0 | 1C1 | 0C0,
A -> 0 | 1,
B -> ABA | D1,
C -> ACA | D0,
D -> _E | _ ,
E -> AE | A }

This is essentially adding two bits at a same offset of two binary numbers and
checking if it matches the trailing bit. [The actual goal was matching correct
additions of two binary numbers in form of a + b = c where a, b and c each
match [01]+.] http://www.wearelondonmade.com/

I wished this could be expressed as:

(?(DEFINE)
(?<s> 0(?&b)1 | 1(?&b)0 | 1(?&c)1 | 0(?&c)0 )
(?<a> 0 | 1 )
(?<b> (?&a)(?&b)(?&a) | (?&d)1 )
(?<c> (?&a)(?&c)(?&a) | (?&d)0 )
(?<d> _(?&e) | _ )
(?<e> (?&a)(?&e) | (?&a) )
) http://www.jopspeech.com/
^(?&s)$

Example matches:
0_00
01_101

Example non-matches:
0_01
100_00011 http://joerg.li/


In case this is declined, _why_ is PCRE exhibiting that behavior?

Essentially: Remove this restriction from PCRE
http://connstr.net/

       Recursion  processing  in PCRE differs from Perl in two important ways.
       In PCRE (like Python, but unlike Perl), a recursive subpattern call  is
       always treated as an atomic group. http://embermanchester.uk/ That is,
once it has matched some of
       the subject string, it is never re-entered, even if it contains untried
       alternatives  and  there  is a subsequent matching failure.
http://www.slipstone.co.uk/
It leads to unparseable context-sensitive grammars like:


{ S -> 0B1 | 1B0 | 1C1 | 0C0,
A -> 0 | 1,
B -> ABA | D1,
C -> ACA | D0,
D -> _E | _ , http://www.logoarts.co.uk/
E -> AE | A }

This is essentially adding two bits at a same offset of two binary numbers and
checking if it matches the trailing bit. http://www.acpirateradio.co.uk/ [The
actual goal was matching correct additions of two binary numbers in form of a +
b = c where a, b and c each match [01]+.]

I wished this could be expressed as:

(?(DEFINE) https://waytowhatsnext.com/
(?<s> 0(?&b)1 | 1(?&b)0 | 1(?&c)1 | 0(?&c)0 )
(?<a> 0 | 1 )
(?<b> (?&a)(?&b)(?&a) | (?&d)1 )
(?<c> (?&a)(?&c)(?&a) | (?&d)0 )
(?<d> _(?&e) | _ ) https://www.webb-dev.co.uk/
(?<e> (?&a)(?&e) | (?&a) )
)
^(?&s)$

Example matches:
0_00 http://www.iu-bloomington.com/
01_101

Example non-matches:
0_01
100_00011 http://www-look-4.com/


In case this is declined, _why_ is PCRE exhibiting that behavior?

--
You are receiving this mail because:
You are on the CC list for the bug.