Thanks for the suggestion, though I think .lineUp() is sufficient for my purposes in this case, since I will need to repeatedly go up the same number of lines, and column isn’t a concern because I’ll always be landing on blank lines.
Search has a “regular expression” mode which will be able to search for anything matching a pattern. Since I assume you want to also delete the matching </span> to go with it, then I believe a regex like the following will work:
FIND = <span data-path-to-node[^>]*>(.*?)</span>
REPLACE = $1
SEARCH MODE = Regular Expression
That worked on the first three spans in your example (and would’ve worked on the fourth if the final /span> wasn’t missing the <