I'm trying to use regular expression in Notepad++ to change spaces to tabs in something like this
01 fsdfsd
01 01 fsdfsd
01 01* fsdfsd
01 01 01 fsdfsd
01 01 01* fsdfsd
How can I keep spaces between numbers and change only the last space?
Thanks.
Search for:
[ ]([a-zA-Z])
(Note that there is a space in front of the character class.) And replace with:
\t$1
An alternative that might be better suited if you also have lines that are of a different format, or if fsdfsd
may contain spaces, is this:
^((?:\d+\*?)(?:[ ]\d+\*?)*)[ ]
Now replace with
$1\t
This matches any space after the longest possible string of digits with optional asterisks separated by spaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With