Re: reg expr...

"Gwyn Judd" <>
11 Sep 2002 23:19:16 -0400

          From comp.compilers

Related articles
reg expr... (Shoaib Ali BURQ) (2002-09-08)
Re: reg expr... (Gwyn Judd) (2002-09-11)
Re: reg expr... (Sarah Thompson) (2002-09-11)
Re: reg expr... (Torben Ægidius Mogensen) (2002-09-12)
| List of all articles for this month |

From: "Gwyn Judd" <>
Newsgroups: comp.compilers
Date: 11 Sep 2002 23:19:16 -0400
Organization: Xtra
References: 02-09-040
Keywords: lex
Posted-Date: 11 Sep 2002 23:19:16 EDT

"Mein Lufkissenfahrzeug ist voller Aale"
said Shoaib Ali BURQ ( in
> I'm looking for a regular expression that say:
> match the line that does not begin with the string {s}
> now the way i see it ... if my s = "abc" then i will have to look for
> (a & b) or (ab & not c) or (abc & not wht_spc) ...
> but the longer the s the longer the reg expr ... is there another way to
> do this?

This depends on the regular expression dialect. In Perl you might do:


These type of extensions are not supported in every language though. Another
way that does not require a look-ahead is:


if you need to combine this with some other action, then you have to use two
operators and combine them with "and":

!m/^abc/ and m/something/

Gwyn Judd (print `echo '' | rot13`)
diplomacy, n:
Lying in state.

Post a followup to this message

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