Re: PCRE regexp compiler.

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Organization Gobo
Message-ID <[email protected]>
Tao Feng wrote:
> "indexing" does match either of those patterns, but
> after that match, has_matched never be false, no
> matter how many times I call "next_match".
> 
> Which means that I get this in a loop of querying
> captures of match:
> "indexing"
> ""
> ""
> ""
> ""
> ""
> ""
> .
> .
> .
> .
> (infinite)

It's because the empty string is a valid match.
You should either use "[a-z]+" instead of "[a-z]*"
as regexp, or call:

    my_regexp.set_empty_allowed (False)

before calling the match features. See comments
in RX_PCRE_COMPILER.is_empty_allowed for details.

-- 
Eric Bezault
mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]
http://www.gobosoft.com



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gobo-eiffel/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
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.