m-ender / retina

A regex-based programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Patch newline escape sequences into replacement strings

m-ender opened this issue · comments

.NET doesn't have an escape sequence for newlines that's understood by Regex.Replace (like \n or $n). This means that there is no way to include newlines in the replacement strings if -s mode is used. Hence, Retina should preprocess replacement strings and substitute \ and LF for \\ and \n, respectively.

This has been implemented as $n to be consistent with other substitution elements.