in reply to Re: performance enhancement
in thread performance enhancement
The "normal" way to do this is with two substitutions
Ive often pondered on an optimisation of $s=~s/^\s+|\s+$/g so that this is no longer true. So far its been over my head in the sense of requiring too much research time to implement compared to other useful tasks that I can do, but maybe one day...
And for people wondering why this isn't the recommended way, its because this pattern will try to match every point in the string. The regex engine isnt currently smart enough to optimise this to only try the pattern twice.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: performance enhancement
by GrandFather (Saint) on Jul 19, 2006 at 23:46 UTC | |
by demerphq (Chancellor) on Jul 20, 2006 at 12:30 UTC |