Have a look at this Word document:
It is good typographical practice to insert non-breaking spaces before all units. This way units and numbers are kept together when word-wrapping.
Adapt the following syntax to your needs to cover all units in your target text. The Find string covers units before spaces, tabs and line breaks:
(?<=\d+) (?=(A|bar|Hz|min.|minu(ut|ten)|V)(\s|$))
Note the space after the first closing bracket.
In the Replace field you type a non-breaking space (Alt+Space on a Mac). Tick the Regular expression box:
The exported Word document looks like this:
Note that –as intended– no non-breaking spaces are inserted at the yellow highlighted positions that don't match with the last part of the regular expression (white space/end of line).
See also: Inserting Non-breaking Spaces Before Numbers
Click here for Information about regular expressions in Java
Tip: On a Mac use Typinator to store your regular expressions.