On Wednesday 06 June 2001 18:19, Randal L. Schwartz wrote:
> That's a good approach, but maybe this one is more straightforward:
>
> $_ = q{whatever "this" 'line is'};
>
> my @elements;
> push @elements, $1 while
> /\G\s*"(.*?)"/gc or
> /\G\s*'(.*?)'/gc or
> /\G\s*(\S+)/gc;
>
> print map "<<$_>>", @elements;
>
> The use of scalar /\G...../gc to inchworm along a string is a powerful
> technique.
Yes, this is better. With one exception - you're not handling \' and \" (but
this can be copied from previous example).
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112
- splitting strings with quoted white space Peter Cornelius
- Re: splitting strings with quoted white space Chas Owens
- Re: splitting strings with quoted white space Ondrej Par
- Re: splitting strings with quoted white space Randal L. Schwartz
- Re: splitting strings with quoted white s... Jeff 'japhy' Pinyan
- Re: splitting strings with quoted whi... Randal L. Schwartz
- Re: splitting strings with quote... Jeff 'japhy' Pinyan
- Re: splitting strings with quoted white s... Ondrej Par
- Re: splitting strings with quoted whi... Randal L. Schwartz
- Re: splitting strings with quote... Randal L. Schwartz
- RE: splitting strings with quote... Accountant Bob
- RE: splitting strings with q... Jeff 'japhy' Pinyan
- Re: splitting strings wi... Ondrej Par
- Re: splitting strings wi... Jeff 'japhy' Pinyan
- RE: splitting strings wi... Accountant Bob
- RE: splitting strings wi... Jeff 'japhy' Pinyan
- Re: splitting strings with quoted white space M.W. Koskamp
