Re: additional regular expression operators

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Thu, 16 Apr 2009 17:57:15 +0000 (UTC)

          From comp.compilers

Related articles
[3 earlier articles]
Re: additional regular expression operators haberg_20080406@math.su.se (Hans Aberg) (2009-03-30)
Re: additional regular expression operators torbenm@pc-003.diku.dk (2009-03-31)
Re: additional regular expression operators rpboland@gmail.com (Ralph Boland) (2009-03-31)
Re: additional regular expression operators torbenm@pc-003.diku.dk (2009-04-14)
Re: additional regular expression operators zayenz@gmail.com (MZL) (2009-04-15)
Re: additional regular expression operators anton@mips.complang.tuwien.ac.at (2009-04-16)
Re: additional regular expression operators gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-04-16)
Re: additional regular expression operators torbenm@pc-003.diku.dk (2009-04-17)
Re: additional regular expression operators mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2009-04-17)
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Thu, 16 Apr 2009 17:57:15 +0000 (UTC)
Organization: California Institute of Technology, Pasadena
References: 09-03-111 09-03-123 09-04-001 09-04-024
Keywords: lex
Posted-Date: 17 Apr 2009 06:12:03 EDT

Torben ?gidius Mogensen <torbenm@pc-003.diku.dk> wrote:
> Ralph Boland <rpboland@gmail.com> writes:


>>> > R% : equivalent to the string (R~)R


Someone else wrote:


>>> I can see the usefulness of the first two, but not really
>>> the third. Do you have an example?


(snip)


Sometimes you want to find the shortest match. (I believe the GNU
regexp has an operator for it, but I don't remember what it is.)


^.*XYZ


will normally match up to the last XYZ on the input record, but
sometimes you want the first one. I do agree that there should be a
convenient operator for that.


-- glen


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.