chuck icon indicating copy to clipboard operation
chuck copied to clipboard

Regex replacement interprets periods as including newlines

Open wasamasa opened this issue 8 years ago • 2 comments

<<< RegEx.replace(".*", "...", "foo\nbar") >>>;

Expected output: "...\nbar"

Actual output: "..."

To rectify this, one needs to rewrite the pattern as "[^\n]*".

wasamasa avatar May 15 '16 16:05 wasamasa

Thanks- just to confirm, what operating system did you see this on? Oddly enough we use different regex backends depending on the OS.

spencersalazar avatar May 17 '16 09:05 spencersalazar

This is on Arch Linux, with ChucK 1.3.5.2.

wasamasa avatar May 17 '16 09:05 wasamasa