0 votes

I thought I should start a new topic on this instead of continuing the discussion on a different topic line.

I would like to delete all \s lines (\s, \s1, \s2, etc.) The lines are empty. I can easily delete the markers, but I’m not sure how to delete the lines.

The two following solutions have been proposed, but haven’t worked:
\s\d? [^\]* (did not find any of the \s markers)
\s\d? [^\r]+\r\n (deletes all lines one by one including verses)

Any other ideas?

Paratext by (127 points)
reshown

2 Answers

0 votes
Best answer

Hi anon928451,

I think those the two RegEx you listed need another \ before \s at the beginning of the line.

Are there any \s which contain text, or are all \s in the project empty?

If they’re all empty, I think you can do a simple text search for \s and replace it with nothing. And then do another search for \s1, etc. You don’t need to use RegEx. Paratext will take care of cleaning up the empty lines. Of course, if you delete the \s and there was actually text after them, you’d be making a bit of a mess.

by (578 points)

Perfect. I didn’t know Paratext would take out the empty line. Thanks!

Just to add to @LivingField’s comment, you should search for \s1, \s2, etc first, and only delete \s as the last thing.

Why? Because if you delete all the \s markers, every \s1 will just turn into a random 1 hanging out in the middle of your text.

0 votes

Just to make sure it is clear, in RegEx Pal (available on the main Paratext menu, under Advanced), you can search for: \\s\d? [^\r]+\r\n and replace it with nothing to remove section headings. That includes the extra backslash that LivingField was talking about. (It’s possible that the previous posters didn’t mark their regular expression as “Preformatted text” when they were writing their post, so one of the backslashes was “eaten” in the output.)

Replying to @mnjames, this regular expression automatically takes care of all forms of section headings, \s, \s1, s2, etc. The regex contains \d?, which tells it to match an optional digit, so that matches all of those section heading forms. You don’t need to search for the \s markers separately.

by (1.3k points)
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
How good and pleasant it is when God’s people live together in unity!
Psalm 133:1
2,450 questions
5,139 answers
4,835 comments
1,240 users