gnu-regexp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Regexp] Re: Some queries


From: Wes Biggs
Subject: [Regexp] Re: Some queries
Date: Wed, 26 Feb 2003 12:36:45 -0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130

Hardeep Singh, Noida wrote:
Hi Wes,

I have some queries about the package:

1. The document says that the package is a traditional NFA. However, it
appears to be POSIX NFA, although it might not conform to all POSIX
standards. I believe this for the following reasons:
        a) A Traditional NFA stops as soon as it has found ONE match. It
does not try to look for other possible matches of              longer
length. For example the regexp 't(e|es).' (without quotes) should match
'tes', not 'test' if given the          text 'test'. This is because this
match is found first. Unless an NFA regexp continues with the motions, it
will            not find the match 'test' which is longer and starts at the
same position, which is the way a POSIX NFA works.
        b) Ditto for 'a(one)?(onetest)?' when applied to 'aonetest'. Should
match 'aone' and not 'aonetest'

Yes.. it's really not completely one or the other. I've tried to implement POSIX features where possible -- sometimes at the cost of performance. I have thought about making this configurable, so you could trade off speed vs. POSIX correctness.

2. There appears to be a bug, although it may be a design decision. When
case insensitive matching is applied with pattern '(\w+)\1' to text 'Okok',
it does not match.

True. I suppose the thing to do would be match the user expectation, which is probably that it will match. Is that how it works in Perl?


3. Could you provide a link to my writeup on regular expressions so that
people interested in regexps can find it easily. The link is:

http://www.seeingwithc.com/topic7html.html

Sure.  Next time I update the site I will put in the link.

Wes





reply via email to

[Prev in Thread] Current Thread [Next in Thread]