in my lexer I wrote the following regex:
"///"\s*[^@\s].*
I executed byacc/j in debug mode and it states that the following line matched the regex.
But why does this regex match this line?
/// @Service( version="1.0.0" )
I also tried "///"\s*[^\@\s].*
, in case @
is a special character, but it also matches. o.O
I thought my regex would match only a string that starts with ///
followed by optional whitespaces. Than any non-whitespace character except @
must come, followed by any characters.
Edit: I'm sorry I meant the regex is used within jflex, not byacc/j.
Workaround: In the jflex documentation I didn't find any \s
escape sequence, so I tried this regex "///"[ \t\f]*[^@ \t\f].*
and it worked. It seems that the \s
escape character is not supported and silently ignored by jflex.