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

Top Page
Delete this message
Author: Zoltan Herczeg
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1447] 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




--- Comment #7 from Zoltan Herczeg <hzmester@???> 2014-02-26 14:25:19 ---
The ovector contains offsets, there is no string length. MARK is excellent for
enumerations:

/\d+(*:handleNumber)|\w+(*:handleString)/

or simply (*:0), (*:1) and substract '0' (48 in ASCII) from the first character
of the MARK to get the index, or a-z if you have more than 10 cases, or call
atoi() if you have thousands of cases.

Currently you only have one MARK. Maybe a multimark could extend it further
(perhaps up to 9): (*MARK0:a), (*MARK1:b) or (*0:a) (*1:b) as a short from, but
I am not sure we really need such extension.


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