Regex matches in find tool containing newlines cannot be replaced

I’m not entirely sure if this is a missing/unimplemented feature or an actual bug, but it appears that you cannot replace matches in the script editor’s find and replace tool that contain newlines. The find tool will successfully match expressions containing newlines, but pressing the replace button will do nothing.

Replace tool doesn't actually replace the string

Notably you can only capture newlines when using regex, so my very uneducated guess is that the replace tool has not been set up to handle new lines since (I’m assuming) most of the time people do not use regex mode.

Expected behavior

Given the following script,

local Something = {
	"Hello Regex!"
}

the regex expression local.+?\{\n.+?(".+?")\n\} and replacement print(\1) should transform it into

print("Hello Regex!")

Expected behavior replicated in VSCode

Additional Details
Just in case these details are necessary, I have tried this in a Studio instance launched with -disableLoadUserPlugins in a fresh place.
The operating system I am using for Studio is Windows 11.

2 Likes

Thanks for the report! We’ll follow up when we have an update for you.

3 Likes

Thanks again for the report. Currently Script Editor doesn’t support multiline search, this issue is caused by that as well.

Currently we don’t have an ETA on this however we added it to our list of requests.

3 Likes

Hi! We have changes coming to revise the current find/replace functionality, and this will be addressed with those changes. Thanks again!

3 Likes