I want to match non-space characters, so I defined flex file with JFlex:
%%
Value = [\S]+
%%
{Value} { return MyTokens.Value; }
. { return MyTokens.BadCharacter; }
Then I try the generated java code to analyse the string "abc", but I get:
BadCharacter(a)
BadCharacter(b)
BadCharacter(c)
If I change the declaration to :
Value = [a-z]+
Then I can get expected result:
Value(abc)
Why \S
is not working? Isn't it mean "non-whitespace"?