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
CTRE is C++ code, so "yes", but not as part of the actual regex grammar...
#define RX_FLOAT "whatever you want here"
auto res = ctre::match<RX_FLOAT " plus " RX_FLOAT " equals " RX_FLOAT>(teststring);
Don't like defines? you can also get it done by using a compile literal time string ( a bit more advanced than the one in CTRE so you can use + operators).
And you can also split up the regex in multiple ctre calls which may result in better code because the compiler only needs to generate the float pattern match once, which depending on the regex it may or may not do on it's own. This may even end up with more readable C++ code and not require the C++ dev to also be fluent in regex, which may be an issue with really complex regexes. Also... repeating a complex sub-pattern multiple times into a larger pattern may cause quite slow compilation because of multiple rounds in the optimizer.
Is it possible to add custom UserTokens for regular expressions?
For example:
\F
For float numbers:
Or you can give an example, or where to look, how to do this.
The text was updated successfully, but these errors were encountered: