Related articles |
---|
regular expression question gvheurn@gmail.com (Gijs) (2005-06-08) |
Re: regular expression question gah@ugcs.caltech.edu (glen herrmannsfeldt) (2005-06-08) |
Re: regular expression question 148f3wg02@sneakemail.com (Karsten Nyblad) (2005-06-08) |
Re: regular expression question daw@taverner.cs.berkeley.edu (2005-06-08) |
Re: regular expression question gvheurn@gmail.com (Gijs) (2005-06-09) |
Re: regular expression question nicola.musatti@gmail.com (Nicola Musatti) (2005-06-09) |
Re: regular expression question cfc@shell01.TheWorld.com (Chris F Clark) (2005-06-09) |
[6 later articles] |
From: | "Gijs" <gvheurn@gmail.com> |
Newsgroups: | comp.compilers |
Date: | 8 Jun 2005 16:01:34 -0400 |
Organization: | http://groups.google.com |
Keywords: | lex, question |
Posted-Date: | 08 Jun 2005 16:01:34 EDT |
Hi all,
Don't know if this is the right group for this. Can anyone tell me how
to create a regular expression that matches all except for one string?
I tried to use the complement sign ^, but this is only usable for one
character, not for a whole string.
So for example I want to have a RE that matches all strings except for
the string "hello". How do you do this?
I have the feeling this is a very dumb question, but I have no idea how
to get this.
Thanks in advance!
Gijs
[It's not a dumb question, it's a hard question. The complement of a RE
is usually not a RE. My practical advice would be to look for "hello" and
reverse the sense of the test in the surrounding code. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.