UUID matching #168
Replies: 6 comments 6 replies
-
Glad you enjoy using it :) There's no reasonable way to extend it, but you can construct one via an existing text/scanner. There may be a way to configure a text/scanner to do this? If not you'll need to roll your own, which is not too hard. |
Beta Was this translation helpful? Give feedback.
-
Check out the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick reply Alec. Is the default lexer available for extending? I'll be honest, I've no idea where to start to recreate it :-) |
Beta Was this translation helpful? Give feedback.
-
You want this function. It depends on whether the text/scanner can be modified to do what you want. It has some configurability. |
Beta Was this translation helpful? Give feedback.
-
Thanks. I'm happy to just greedily consume the uuid and tried using the |
Beta Was this translation helpful? Give feedback.
-
If |
Beta Was this translation helpful? Give feedback.
-
Hey Alec! Awesome project and easily the best parser library I've used. Just wandering the best way to parse a UUID? The default lexer is perfect for my use case, apart from this one thing. Is it possible to extend the default lexer or would I need to recreate the default lexer and add my specific rule? Cheers!
EDIT: I've tried consuming all tokens in a greedy fashion and this worked great until an 'e' was present, then I got a "exponent has no digits" error, which appears to be an error thrown by the Go scanner.
Beta Was this translation helpful? Give feedback.
All reactions