
March 30th, 2011, 05:05 PM
|
|
Registered User
|
|
Join Date: Oct 2010
Posts: 8
Time spent in forums: 1 h 49 m 6 sec
Reputation Power: 0
|
|
|
Other Language - Help with negative lookahead in regular expression.
I am creating a tool which has a command line option "-d" to specify which usb device to use. I need to make sure there are no characters and I was tyring to use a negative-lookahead. Why doesn't this work in my .l file? :
Code:
-device {
BEGIN DEVICE_NUM;
}
<DEVICE_NUM>[ ]+ /* ignore whitespace */
<DEVICE_NUM>^(?!.[a-zA-Z]*)[0-9]+$ { // fails here
.............
I get this error:
"./mytool.l", line 262: unrecognized rule
please help
|