[pcre-dev] [Bug 617] New: Several questions

Kezdőlap
Üzenet törlése
Szerző: Felipe Nascimento S Pena
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 617] New: Several questions
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=617
           Summary: Several questions
           Product: PCRE
           Version: N/A
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: low
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: felipensp@???
                CC: pcre-dev@???



Hi, have several questions... Maybe don't be bug, but information don't
documented. I think.

* Using PCRE version 7.4 2007-09-21.

See below:

re> /(a(?1))/
data> aa

No match

re> /(a(?-1))/
data> aa

No match

Shouldn't it show error message as "Failed: reference to non-existent
subpattern"?
Who's referenced by (?-1)?

--------------------------------------------------------

In this case:

re> /(?(DEFINE)(?<a>\d+)(?<b>[a-z](?1)))(?&b)/
data> 1a1

0: a1
1: <unset>
2: <unset>

  re> /(?(DEFINE)(?<a>\d+)(?<b>[a-z](?-1)))(?&b)/       
data> 1a1

No match

re> /(?(DEFINE)(?<a>\d+)(?<b>[a-z](?-1)))(?&b)/
data> 1aa

No match

re> /(?(DEFINE)(?<a>\d+)(?<b>[a-z](?-2)))(?&b)/
data> 1a1

0: a1
1: <unset>
2: <unset>

Who's referenced by (?-1) ?

-----------------------------------------------------

re> /(?(DEFINE)(?<a>\d+)(?<b>[a-z](?-1)))(?&)/
data> 1a1

 0: 1
 1: <unset>    


(?&) references first named grouping? This is documented?

-----------------------------------------------------

re> /(?){0}/

Failed: nothing to repeat at offset 5

Nothing to repeat not even nonce?

------------------------------------------------------

re> /(?:?)/

Failed: nothing to repeat at offset 3
re> /(?<a>?)/

Failed: nothing to repeat at offset 5

But /(?)/ is accepted.



Regards,
Felipe.


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