Re: RFC: Adding a new line to a regex
Amos Jeffries <[email protected]> Sat, 22 Jan 2022 06:16:49 +1300
| Newsgroups | gmane.comp.web.squid.devel |
|---|---|
| Message-ID | <[email protected]> |
On 21/01/22 07:27, Eduard Bagdasaryan wrote: > I would concur with Alex that (4) is preferable: It does not break old > configurations, re-uses existing mechanisms and allows to apply it only > when/where required. I have one more option for your consideration: > escaping with a backtick (e.g., `n) instead of a backslash. This > approach is used, e.g., in PowerShell. > > 5a. Recognize just `n escape sequence in squid.conf regexes. > > 5b. Recognize all '`'-based escape sequences in squid.conf regexes. > > Pros: Easier upgrade: backtick is rare in regular expressions (compared > to '%' or '/'), probably there is no need to convert old regexes at all. > Pros: Simplicity: no double-escaping is required (as in (1b)). > Cons: Though it should be straightforward to specify common escape > sequences, such as `n, `r or `t, we still need to devise a way of > providing arbitrary character (i.e., its code) in this way. > You are mixing up different features offered by several of the *many* different languages people call "regex". Squid regex patterns are written in GNU Regular Expression language. None of those commonly expected things are features in that ancient language. Amos _______________________________________________ squid-dev mailing list [email protected] http://lists.squid-cache.org/listinfo/squid-dev