in reply to How to trim a line from leading and trailing blanks without using regex or non-standard modules
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
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to trim a line from leading and trailing blanks without using regex or non-standard modules
by likbez (Sexton) on Aug 14, 2020 at 19:39 UTC | |
by LanX (Saint) on Aug 15, 2020 at 01:04 UTC |