in reply to Re: Re: Re: Re: Re: How to remove the $1 hard coding
in thread How to remove the $1 hard coding
The original RE is m/\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*/. If this is equivilent to splitting on ' ', then I have some serious remedial RE work to do.
The original RE will match 'ABCD' and split it into 4 characters. Your solution using split will not. I am not sure that the original poster is 100% certain about what the initial RE does, and your solution may match intent, but as written the are not the same.
Now, since you are using the pattern \s+ as your split, then your splits are nearly equivilant (leading space and trailing space aside). However, your split is not equivilant to the original RE.
Nothing personal, just technically misleading. All of the info was correct (++), just not related to the OP (--).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ('Re: ' x 6) How to remove the $1 hard coding
by tachyon (Chancellor) on Aug 25, 2003 at 12:25 UTC |