C# regex replace of numbers and units

Try this code:

(?<=\d)(?=[a-zA-Z])

The previous regex will capture the location between numbers and units only if they don’t have a space in between. You can replace this location with a space, and you will be done.

Demo: https://regex101.com/r/yry7Sl/3

Leave a Comment