m-ender / retina

A regex-based programming language.
MIT License
231 stars 10 forks source link

Patch newline escape sequences into replacement strings #22

Closed m-ender closed 8 years ago

m-ender commented 9 years ago

.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.

m-ender commented 8 years ago

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