Related articles |
---|
reg expr... shoaib@students.cs.mu.OZ.AU (Shoaib Ali BURQ) (2002-09-08) |
Re: reg expr... gwyn@thislove.dyndns.org (Gwyn Judd) (2002-09-11) |
Re: reg expr... sarah@telergy.com (Sarah Thompson) (2002-09-11) |
Re: reg expr... torbenm@diku.dk (Torben Ægidius Mogensen) (2002-09-12) |
From: | "Gwyn Judd" <gwyn@thislove.dyndns.org> |
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 (shoaib@students.cs.mu.OZ.AU) 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:
m/^(?!abc)/
These type of extensions are not supported in every language though. Another
way that does not require a look-ahead is:
!m/^abc/
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 'tjla@guvfybir.qlaqaf.bet' | rot13`)
diplomacy, n:
Lying in state.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.