in reply to Re: How to trim a line from leading and trailing blanks without using regex or non-standard modules
in thread How to trim a line from leading and trailing blanks without using regex or non-standard modules
So if you want the exact same semantic, it'll become far more complicated than this regex.
I agree. That's a good point. Thank you !
In other words it is not easy to design a good trim function without regex, but it is possible to design one that used regex, but treating the single quoted string as a special case
For example
trim(' ',$line)
vs
trim(/\s/.$line)BTW this is impossible in Python which implements regex via library, unless you add a new lexical type to the Language (regex string instead of raw string that is used).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to trim a line from leading and trailing blanks without using regex or non-standard modules
by LanX (Saint) on Aug 15, 2020 at 01:04 UTC |