-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Regex in setvar variables #2927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @marcstern , There are a couple of ways to work around that current limitation:
|
Hi @martinhsv,
So my propositionis still valid. As I said, it's fully compatible with the existing behaviour. |
Hi @marcstern , Whether there is a fully-functional workaround or not, a change can always be considered. But I'm not entirely clear on what you are proposing. Could you describe it more fully? What do mean by "eats"? At what stage are you proposing that that happen? |
Hi @martinhsv , Here is my proposal:
|
Context:
Currently, (unescaped) backslashes are forbidden in variables content.
In msre_parse_generic():
The only case a backslash is accepted is when it escapes a single quote or a backslash.
Problem:
You cannot store a regex in a variable: setvar:'tx.var=\babc\b'
When doing this manually, you can escape the string obviously: setvar:'tx.var=\babc\b'
But when you use a macro like the following:
there's no way to call the macro with a parameter compatible with both directives
Solution:
We could be lax (and still compatible with the current behaviour):
Does somebody see any other solution?
The text was updated successfully, but these errors were encountered: