I am afraid you can’t do it with Writer regexp because there is no “designator” for a note.
If you’re brave, save your document as a .fodt and use a macro generator to move the punctuation.
All note information is contained in a <text:note … > … </text:note>
XML element.
Your goal is to match such an element and capture it into a variable (group). Follow it with a set containing the punctuations like [.,;?!]
. The pattern is then
(<text:note .+?/text:note>)([.,;?!])
Replacement action is simply $2$1
.
This is a quick suggestion without testing. Depending on the sophistication of the macro generator, you may need to escape <
or tune the “swallowing” sub-pattern .+?
. Experiment.
PS1: when asking here, always mention OS name, LO version and save format.
PS2: in some languages, countries and typographical traditions, a punctuation may be preceded by a space. Visually, this would suggest the note is relative to the punctuation, not the word preceding it.
This allows for two nuances of notes:
- the anchor is attached to the word: note relates to this word
- the anchor is attached to the punctuation: the note relates to the full sentence or paragraph
How do the guides (particularly those use in North America) translate the difference in significance?