in reply to Re: Re: Parsing issue
in thread Parsing issue

Try this:
#! /usr/bin/perl my $string = q/allow:test1,"@test, 2 " deny:test3,test4 password:"123 + 456doh:"/; while ($string =~ s/(\w+):((\w+|"[\w ,:@]+")(,\s*(\w+|"[\w ,:@]+"))*)\ +s*($|(?=\w+:))//) { print "Argument: $1\n"; my $paramlist = $2; while ($paramlist =~ s/(\w+|"[\w ,:@]+")\s*,*\s*//) { print " Param: $1\n"; } }
However the regexp is starting to get a bit complicated - Text::ParseWords looks like a neater solution.

JJ