Re: Flex regular expression problem

Detlef Meyer-Eltz <>
24 Aug 2005 18:17:32 -0400

          From comp.compilers

Related articles
Flex regular expression problem (pmatos) (2005-08-21)
Re: Flex regular expression problem (Detlef Meyer-Eltz) (2005-08-24)
Re: Flex regular expression problem (Laurence Finston) (2005-08-24)
Re: Flex regular expression problem (Paolo Bonzini) (2005-08-31)
| List of all articles for this month |

From: Detlef Meyer-Eltz <>
Newsgroups: comp.compilers
Date: 24 Aug 2005 18:17:32 -0400
Organization: Compilers Central
References: 05-08-079
Keywords: lex
Posted-Date: 24 Aug 2005 18:17:32 EDT

As John already wrote, you can define a string as : "[^"]*"
A string limited to a single line would be : "[^"\r\n]*"
A string limited to a single line, which may contain other double
quotes preceded by a backslash, is:


Here the first sub-expression delivers the text inside of the double
qotes. This expression is optimized according to Friedl's scheme (see
the help file of the TextTransformer).

It is funny for me that you ask the question just today. Yesterday I
finished a dialog, by which character classes can be defined by
adding, substracting or negation of predefined character classes,
individual characters or ranges and lists of them. By this dialog the
result of a subtraction of '"' from [:print:] yields in:

-[:word:] !#\$%&'\(\)\*\+,\./:;<=>\?@\[\\\]\^`\{\|\}~


(The hyphen is at the begininig, so it doesn't define a range)
The dialog will be included in the next update of the TextTransformer.
If you like, I can send you a little (Windows) test application right


Detlef Meyer-Eltz


> Hi all,

> I'm having some problems generating the regular expression for "any
> printable character except " between ". For example:
> "hello, how are you"
> "212 dasd 2"
> "bugasd "

> " " - Can work!

Post a followup to this message

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