Howdy list,
I'm trying to see if I can do this in one regex instead of multiple
stage, mainly for educational purposes since I already have it in
multipel steps.
I am trygin to get each string between { and } where the {} occurs
between double quotes. So with
"file.optcondition={/Root/Get/Peter}&c={/Root/Get/do}&bleah"={/Root/Blah}
I want /Root/Get/Peter and /Root/Get/do
Seems I could do it if I could do the first grouping wihtout using the
matching () but I dont; thinkm that is possible, any ideas woudl be great!
Danke!
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $string =
q("file.optcondition={/Root/Get/Peter}&c={/Root/Get/do}&bleah"={/Root/Blah});
my @results = $string =~ m{
# ["]
# (
# [^"]*
\{
([^\}]*)
\}
# [^"]*
# )*
# ["]
}xmsg;
print Dumper [EMAIL PROTECTED];
$VAR1 = [
'/Root/Get/Peter',
'/Root/Get/do',
'/Root/Blah'
];
Uncommenting those gets:
$VAR1 = [
'file.optcondition={/Root/Get/Peter}&c={/Root/Get/do}&bleah',
'/Root/Get/do'
];
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>