On Mon, 12 Dec 2005, Xavier Noria wrote: > On Dec 12, 2005, at 22:10, Owen wrote: > > > Xavier Noria wrote: > >> On Dec 12, 2005, at 11:10, Alexandre Checinski wrote: > > > >>> I have a string that looks like this : > >>> <counter id="183268" since="SDOPERFV16" aggr="Sum" > >>> name="pcmTcuFaultOutOfService"/> > > > >> > >> m// in list contex may help: > >> > >> my ($id, $name) = $xml =~ m{id="([^"]*)".*name="([^"]*)"/>};
> The answer is short, but since you already did this effort I'll tell > you a way to figure out what's missing that's very close to your > approach: Ask japhy's YAPE::Regex::Explain about it: > > use YAPE::Regex::Explain; > print YAPE::Regex::Explain->new(qr{id="([^"]*)".*name="([^"]*)"/ > >})->explain; Thank you for bring that module to my attention, it is truely instructional. It says of [^"]* any character except: '"' (0 or more times (matching the most amount possible)) So having now read the appropriate section in my Programming Perl, I see "A caret in front of a list causes it match only characters that are NOT in the list" Thank you Owen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>