I am creating an app that contains some OT books that are polished drafts, for community feedback. I want to make it very clear that the text is in draft state. So, I would like to add the line
\s2 \bd_[Translation is in draft state]\bd*
[Translation is in draft state]
throughout the text.
Notably, on its own line after each instance of
\mt1 book title \is introduction section heading \c chapter \s1 section heading
This is the regex I attempted:
(Look for any instance of those markers with optional text after them)
\1\2\\s2 \\bd_\[Translation is in draft state\]\\bd\*\n
(Replace it with the same, but add a new line that says "[Translation in draft state])
This just garbled the entire book. I tried some variations, such as this simplification:
(look for a section header)
\1\ \\bd_\[Traducción estado borrador\]\\bd\*$
(replace it with the same and add the warning on the same line)
But that caused the app to freeze.
Any ideas on how to make such a regex? Thanks!
Also, two related questions:
- What regex flavor does SAB use? I couldn’t find it noted anywhere.
- Are the changes made when the app is compiled, or when it is opened on the device?
Key term: regular expressions