logging {
category lame-servers { null; };
category cname { null; };
};
zone "." in {
type hint;
file "root.cache";
};
zone "127.IN-ADDR.ARPA" {
type slave;
file "127";
masters { 10.10.1.113; };
};
Returns:
logging { category lame-servers { null; };
category cname { null; };
zone "." in { type hint; file "root.cache";};
zone "127.IN-ADDR.ARPA" { type slave; file "127"; masters { 10.10.1.113; };
It's splitting when it finds "{}"'s embedded in "{}".
Now, I want to break it up into 3 logical "sections". I can get it to split using this regex:
foreach my $lines(@temparray) #where temparray is the above { chomp $lines; $string=$string.$lines; } while($string=~/(\w+ )([\w\W\d]+?\};)+?/g) { print "$1$2<br>"; }
while($string=~/(\w+ )([\w\W\d]+?\};\n)+?/gm)
In reply to multiline, global regex by maj12
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |