|Re: Regular expression escaping in configuration file [message #1768462 is a reply to message #1768347]
||Wed, 19 July 2017 06:42
|| Elemer Lelik
Registered: January 2015
Please try to double-escape (e.g. as in '\\$') the symbols in question;
Here's why: there are at least two parsers that will interpret your string:
the config file parser and the regexp parser of the TELNET port, each with a different mission and set of rules.
Some special characters ( "^", "$", "\", """ etc.) can be interpreted literally or as a control character and interpretation may be different from layer to layer.
For instance the first parser may recognize the special character \n as "newline" and send it as 0xd to the next parser ;
but it may not recognize \$ (it's not a C-style escape) and it may send it to the next parser as literal \ followed by literal $
However if you escape "\" (as in "\\$") this will force interpretation of "\$" as "end of line" regex and the first parser will send "\$" (as control character) to the next parser.
(This is a theoretical example, I did not check the Titan code, but this is a typical scenario on the web, making thousands of hacks possible :) )
I hope this makes sense
Please let me know if it works
[Updated on: Wed, 19 July 2017 09:06]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01716 seconds