how to fix \: being treated as an unrecognized escape sequence? #820
-
I am using trust to rewrite a go project. The code needs to read the regular expression from the yaml file and then match it. However, the expression in the yaml file in the go project has a , and an error is reported when trust compiles the regular, unrecognized escape sequence. Is this the problem of trust?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
So it's not quite clear what you're asking here. Here's the regex compilation error:
Could you say what is confusing about this? It's saying that Many regex engines permit escaping any character, even if it's not necessary or otherwise doesn't do anything. This regex engine is a bit more strict about such things. There are some open tickets for relaxing it somewhat, but just haven't gotten around to it yet. Although I'm not sure it would be relaxed to the point where it would help you here. |
Beta Was this translation helpful? Give feedback.
So it's not quite clear what you're asking here. Here's the regex compilation error:
Could you say what is confusing about this? It's saying that
\:
is an unrecognized escape sequence, and it is. That's correct. Are you trying to escape:
? If so, why?:
is not a regex meta character and doesn't require escaping.Many regex engines permit escaping any character, even if it's not necessary or otherwise doesn't do anything. This regex engine is a bit more strict about such things. There are some open tickets for relaxing it somewhat, but just haven't gotten around to it yet. Although I'm not sure it woul…