Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upConsider passing through escaped non-escape sequences #1443
Comments
brian-brazil
added
the
enhancement
label
Mar 1, 2016
This comment has been minimized.
This comment has been minimized.
|
Trying to do magic with escaping is risky, as it makes it unclear exactly which layer is interpreting which escape sequences. It gets to be even more fun if a layer changes the escape sequences it knows about. I'm for keeping a strict definition of escaping. Letting our users be lax in how many backslashes they must provide is likely to cause more problems than it solves in the long run.
That's completely normal. If we want to avoid that in a sane way we'd have to look at something like Python's |
This comment has been minimized.
This comment has been minimized.
|
Oh, to be honest, I didn't know about the backtick behavior. So instead of changing the behavior of the backslash, we'd need to ask users to use backticks in such situations? This sounds reasonable to me. |
This comment has been minimized.
This comment has been minimized.
|
Backticks can't handle backticks inside them, so to be fully generic a client would have to support our escaping. |
grobie
closed this
Mar 2, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
grobie commentedMar 1, 2016
Prometheus is currently very strict about escaped characters if these are not an escape sequence.
This requires characters in regular expressions to be double escaped.
This makes it bit more inconvenient to escape meta characters in regular expressions. More problematic though, it is an issue with Grafana among others, which escapes all kinds of characters by default grafana/grafana#2918.
If we just ignore such cases, we should make it easier for people to escape meta characters in regular expressions. It should be backwards compatible, as a currently escaped backslash will continue to work.