flex not matching minus sign more than once

erinf@jobsoft.com (Erin)
10 Aug 2003 11:00:46 -0400

          From comp.compilers

Related articles
flex not matching minus sign more than once erinf@jobsoft.com (2003-08-10)
Re: flex not matching minus sign more than once rkrayhawk@aol.com (2003-08-10)
| List of all articles for this month |
From: erinf@jobsoft.com (Erin)
Newsgroups: comp.compilers
Date: 10 Aug 2003 11:00:46 -0400
Organization: http://groups.google.com/
Keywords: lex, question, comment
Posted-Date: 10 Aug 2003 11:00:46 EDT

i'm using flex v. 2.5.4 and i've run into issues with matching a literal minus sign.




code snippet:


SP [^A-Za-z0-9 ]
MINUS ("-")
AN [A-Za-z0-9 ]


(({AN}|{MINUS}){2,15}{SP}{1}){1} works correctly
(({AN}|{MINUS}){2,15}{SP}{1}){2} does not - flex gets hung up


i've tried:
MINUS [-]
MINUS (-)
MINUS -


i've also tried:
({AN}|{MINUS}){2,15}{SP}({AN}|{MINUS}){2,15}{SP} does not work
({AN}|{MINUS}){2,15}{SP}({AN}){2,15}{SP} works


does anyone have a clue as to what i'm doing wrong?! thanks so much!


erin
[I've never had a lot of luck with named patterns. I suspect there are some
long-standing bugs that haven't been shaken out. -John]


Post a followup to this message

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