I'm trying to use a regexp to remove white spaces where there are more than 2 spaces and leave just one.
I'm testing with sed and this regexp works ok:
Code:
sed -e 's/\s\{2,\}/ /g' teste2.txt
But when I try to use the same regexp in a perl script:
Code:
$line=~s/\s\{2,\}/ /g;
Has no results. It leaves the spaces without removing where there are more than 2 white spaces.
This kind of regexp should be coded different in perl?
Thanks,
Matías