Re: Regular expression question

Mat Sutcliffe <[email protected]>
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <CACE5BzLRsFkg=VGjNAB6xwqXzs+u2fA2qzLZ0pzqTQhtaDhb4Q@mail.gmail.com>
On 19 August 2012 14:17, Mat Sutcliffe <[email protected]> wrote:

> If you replace your pattern "el" with "(el)" you should get an array with
> one member. If you use the pattern "((e)(l))" you should get three members.
> But I think that because of a bug in csRegExpMatcher::Match, those three
> members will correspond to the substrings "el", "el" and "e". To fix the
> bug, the array of regmatch_t structures passed to regexec should have
> length regex.re_nsub+1. Then matching the pattern "el" would give one array
> member, matching "(el)" would give two members, and "((e)(l))" four
> members. This is a breaking API change, but would make regexes work as
> intended. As it is currently, you always lose the final subexpression match.
>

The breaking API change could be avoided by always discarding the first
subexpression match in the array.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
Crystal-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-develop
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.