in reply to Parsing issue
Note that this simple example splits the parameters on a comma symbol, so will break on something like#! /usr/bin/perl my $string = q/allow:test1,"@test 2 " deny:test3,test4 password:"123 + 456"/; while ($string =~ s/(\w+):(.*?)($|(?=\w+:))//) { print "Argument: $1\n"; my @params = split /,/,$2; print " Param: $_\n" foreach (@params); }
But it should get you started.test:"This, contains, commas",foo,bar
JJ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing issue
by zigdon (Deacon) on Oct 08, 2002 at 12:26 UTC | |
by jj808 (Hermit) on Oct 08, 2002 at 12:56 UTC | |
|
Re: Re: Parsing issue
by hotshot (Prior) on Oct 08, 2002 at 14:06 UTC | |
by jj808 (Hermit) on Oct 08, 2002 at 15:40 UTC |