So I’ve been studying up on LibreOffice Regular Expressions.
I’ve got a file that uses Markdown (Twine to be specific). I am manually copying and pasting the text from it to LibreOffice.
Now that the Text is in LibreOffice, I want to format the text (using Regular Expressions) based on certain sets of Characters before and after them. So …
- All
**Any Text Here**
, I want the Text to be Bolded - All
_Any Text Here_
, I want the Text to Italicized - All
<%Any Script Here%>
, I want the Text to be in “Courier New” Font
I have figured out the proper Regular Expressions I need to put in Find for the 3 above examples I mentioned:
\*\*.+\*\*
_.+_
<%.+%>
And I know how to use the Format button for the Replace field (for changing the Style and/r Font), but …
What can I put in the Replace field in order to keep the Text?
- If I leave Replace empty, it just replaces each instance of the Regular Expression with no text.
- If I put in the same regular expression in Replace as I put in Find, it just literally replaces each instance of the Regular Expression with the text of the Regular Expression. So if I put
\*\*.+\*\*
in Replace, all Regular Expressions of\*\*.+\*\*
is now the literal text\*\*.+\*\*
, but formatted with what I set in Format (and not the text it had before).
I hope my question makes sense.