This needs to be via sed sadly and from what I can tell, reverse matches don't work.
I have an incorrect string that I need to insert a space into, this incorrect string can take the format:
>=5.0.0 <= 7.0.0
>5.0.0 <= 7.0.0
=5.0.0 <= 7.0.0
I need to insert a space before the first number and only if there isn't a white space present (we have hundreds of string that are correct so double whitespaces would break them).
The desired output is
>= 5.0.0 <= 7.0.0
> 5.0.0 <= 7.0.0
= 5.0.0 <= 7.0.0
I've tried playing with grouping but haven't quite got it:
echo $testString |sed 's/\(\S\)\w/\1 &/'
>= =5.0.0 < 7.0.0