Finding things in Shortcuts

This is specific to the Replace and Match actions in Shortcuts, and assumes you know something about those already.

Line breaks

You can replace line breaks in text via the following:

  • searching for the "line break" character. You can get this character by either copying a line break from existing text, or dictating the words "line break" into the search field (which I find easier)
  • searching for "\n". This will match all line breaks, but under the settings for the Search action, you will need to have Regular Expression turned on.

Edge case

There's one odd edge case. If you paste attachments into a note, and then bring the text content of that note into Shortcuts via the share sheet, you'll notice that the note looks like this:

Image
Image
Image

This is the note's content here

If you try to remove those Image lines by searching for Image\n, it won't work. The line break at the end of each Image is not a regular line break.