Can you search for a newline in the "find" box of the source window?

I can't figure out how to search for a newline using the find/replace tool in Rstudio.

I know it's a regex search, and I've tried several variants (\n, \\n, \r\n) with the regex box checked, but none seem to work. The only info that comes up in a google search suggests that this might be a limitation of the Rstudio IDE.

Is it true that you can't use the find box to search for a newline? If not, what am I doing wrong? TIA

1 Like

Here is a further confirmation that this isn't possible, unfortunately.

Just in case you missed it, you are aware that you can use $ for end of line?

Thanks for the confirmation. In that GH issue, they also say:

Categorizing this as a feature request -- to support this request we would have to provide support for multiline matches, and we currently only support matches of any kind within a single line of text.

What I really need to look for is two newlines in a row, so it sounds like this is not possible for more than one reason, for now.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.