Is there a way to only find/replace non-breaking spaces that are NOT preceded by a number?

I have a document with a ton of non-breaking spaces that I have to remove. I can find all using regular expressions \d+\u00A0 but I don’t want to select the ones that are following a number.

For instance, in this example I am using the ~ to represent non-breaking spaces. I want to replace all the ~ with a regular space, but leave the ~ that are proceeded by a number (ie: 1~).

1~Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus posuere, ante~et~elementum pretium, eros purus posuere2~augue, ac pellentesque metus dui ut libero. Maecenas odio felis, porttitor in ultricies in, dictum eu lectus. Vivamus quis~faucibus lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse eleifend libero lorem, a tristique~ligula mattis ac. 3~Pellentesque a scelerisque nisl. Aenean sit amet mattis ligula,~sit~amet rhoncus massa. Pellentesque gravida ipsum vitae tempus interdum. Morbi mattis nisl in efficitur porttitor. Phasellus eu rutrum libero. Sed vitae vestibulum neque. Mauris ac orci et ipsum sollicitudin elementum at non~urna.

Is there a way to only find/replace non-breaking spaces that are NOT preceded by a number?

For me regex \u00A0(?<![:digit:]\u00A0) seems to work (I’m pretty sure somebody has a shorter one). Though your question seems a bit ambiguous to me, since I understand from your description 1~ should be kept, hence you want to find all non breaking spaces, which haven’t a number preceded, but you state in your last sentence non-breaking spaces that are NOT followed by a number (no part of your sample text fulfills this (followed by is ~# for my understanding).

Opaque, first, you are correct that I miss-spoke and should not have said “followed by a number” but “preceded by a number.” I have corrected my question to make it clear.

Second, your suggestion works perfectly! I can now fix my documents in minutes instead of hours. Thank you.


Please do **not** use *Add Answer* if you actually don't answer a question but commenting an answer or responding to another user’s comment. Please use ***add a comment*** for that purpose. Thanks in advance …

For the records (according to “Answer” of @csg)

use \u00A0(?<![:digit:]\u00A0)