DeusVult has asked for the wisdom of the Perl Monks concerning the following question:
"x:= y + z;" <-- gotta love the pascal reference
Then the tokens woule be x, :=, y, +, z, and ;. (Btw, I'm not actually parsing pascal, but I just wanted to use something most people would probably recognize/understand).
But if I split on whitespace, the contents of my array would be:
( "x:=", "y", "+", "z;" )
So I need to run a second split on each element of the array, in such a fashion that it will split the letters/numbers from the punctuation (or at least I think that's what I need to do, but I'm not dedicated to the idea philosophically--if someone comes up with a one pass solution, I'll be perfectly happy to use it).
Thank you all yet again.
Some people drink from the fountain of knowledge, others just gargle.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Splitting inside an array
by kschwab (Vicar) on Feb 05, 2001 at 22:04 UTC | |
Re: Splitting inside an array
by jeroenes (Priest) on Feb 05, 2001 at 22:07 UTC | |
Re: Splitting inside an array
by chipmunk (Parson) on Feb 05, 2001 at 22:11 UTC | |
Re: Splitting inside an array
by kilinrax (Deacon) on Feb 05, 2001 at 22:10 UTC | |
Re: Splitting inside an array
by Anonymous Monk on Feb 06, 2001 at 02:20 UTC | |
Re: Splitting inside an array
by Fastolfe (Vicar) on Feb 06, 2001 at 02:26 UTC | |
by petral (Curate) on Feb 06, 2001 at 06:57 UTC | |
by Fastolfe (Vicar) on Feb 06, 2001 at 09:10 UTC | |
Re: Splitting inside an array
by lemming (Priest) on Feb 05, 2001 at 22:11 UTC |