How do you implement an exact match token #55
Unanswered
dryan-cais
asked this question in
Q&A
Replies: 1 comment
-
Never mind; just my lack of skill using regular expressions. This is what I needed: https://www.regular-expressions.info/wordboundaries.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Imagine a dynamic list of allowable fields: somefield, somefield2, somefield3
I can create a regex token for the allowable fields dynamically resulting in something like:
The problem is that the first match for "somefield2" is "somefield" resultings in parser error due to unexpected "2" (not withstanding it matches the wrong field anyway).
This can be fixed using an exact match:
Unfortunately, when I look to extend the grammar to support stuff like "somefield2=blue", when there is no whitespace, the exact match falls over.
Apologies for what is probably a newbie question but I can't get my head around this. Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions