[pcre-dev] [Bug 1447] New: Support for Enumerations

Top Page
Delete this message
Author: Go L Elijah
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1447] New: Support for Enumerations
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1447
           Summary: Support for Enumerations
           Product: PCRE
           Version: N/A
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: wishlist
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: janmeijer@???
                CC: pcre-dev@???



I believe regular expressions lack a construct (ignore the spaces):

(?@ aaa | bbb(d*) | ccc(a*) | ddd)

which, when applied to

"cccaaaddd"

results in this (PHP-alike notation):

array("cccaaa", 2, "aaa")

meaning the (?@ ... ) captures as an integer, and the clauses merely enumerate
options.

this may be an attractive substitute (with identical output):

( aaa (?0)| bbb(d*) (?1)| ccc(a*) (?2)| ddd (?3))

however, the numbers are now optional, which requires a dynamic typing scheme
as in PHP. but it would also allow for:

( aaa (?"one")| bbb (?"two")| ccc (?"three")| ddd (?"four"))

which means that certain patterns can be replaced by a canonical pattern.

anyway, you can see where this is going.


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