You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This does indeed look like a bug, thanks for reporting it. But it's mostly a bug in error reporting (sorry :-)). Enabling the use of macros in character classes like [..] seems to have uncovered a whole bunch of combinations that aren't properly rejected.
In this case, {white} is a full regular expression (.. | ..), not itself a character class, so it can't be used inside the [..].
For fixing your specific problem, it looks like you might be wanting just ({white}|.) instead of [{white}|.]. That said, this is equivalent to just [^] (any character, including newline).
On the danger of doing your homework for you, there is a pitfall with this: "/*" [^]* "*/" will not quite match a slash-star comment. E.g. it will match all of /* abc */ return x; /* abc */ in one go, because JFlex will always give you the longest possible match.
The expression you'd need is "/*" followed by any string that is not "*/", followed by "*/". There is a special operator for this in JFlex (not present in usual regexp engines). You can write: "/*" ~"*/"
Hi, as part of school work I'm using jflex to generate a scanner.
I'm trying to write a regex to handle
/* comments */
.This is the error I'm seeing.
This is the regex I'm using
The text was updated successfully, but these errors were encountered: