Perl: the Markov chain saw | |
PerlMonks |
Re: How to trim a line from leading and trailing blanks without using regex or non-standard modulesby LanX (Saint) |
on Aug 14, 2020 at 03:28 UTC ( [id://11120705]=note: print w/replies, xml ) | Need Help?? |
> which clearly is an abuse of regex. Why is it an abuse of regex? Problem is that \s is a meta character for any white-space not only blank " " , but only usable inside regex.° So if you want the exact same semantic, it'll become far more complicated than this regex. But better define your own trim() using a regex inside.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|