Both of the above answers give the result, but in both cases there is a space at the beginning and end of the line.
If I use this regular expression in the string "hello world" , I get the answer as "peace hello"
To get the result as βhello worldβ , the following perl regex will work just fine
$a =~ s/(?<!\w) //g;
Using appearance, all extra intervals are deleted.
Denim datta
source share