質問

So if I wanted to key in an Arrow character, -->, via JFlex's regex, I'd figure it would just be the string "-->". However, if I attempt this, I always get a Could not match Input error.

"-->"   {}

Doesn't work. Neither does a combination of escaping certain characters as far as I can tell. I know each of those characters is special in flex, and I know the /-->/ literal way that works in other languages wont in Java.

What am I missing?

役に立ちましたか?

解決

If I understand correctly, you're trying to find a match for '-->'? If so, the expression [\-\-\>]+ fill find that match.

Tested at http://www.regexplanet.com/advanced/java/index.html

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top