Identify words that may contain numbers without selecting numbers #911
-
I have a set of rules to identify tokens, that are used for more complex statements.
however, this breaks under examples where the word starts with a number and contains more letters, such as I placed the Example of what I tried, but is not sufficient
Any ideas on how to extend the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Based on the first version of your code
If you put
If that isn't enough, can you provide a little more detail:
Totally unrelated your I wrote recipes for numbers for parsing Lua that you are free to steal:
Feel free to tip you found this helpful. |
Beta Was this translation helpful? Give feedback.
Based on the first version of your code
word
doesn't match3a33aa
becauseword
specifically begins with a required(ASCII_ALPHA|"_")
so it's never going to match things that start with a number. Change that to be more permissive:If you put
number
beforeword
inbase_term
it will greedily capture numbers (3
and33
) and things like3a33aa
will fall through and be captured byword
.If that isn't enough, can you provide a little more detail:
WHITESPACE
)…