G
Gyruss
Hi,
I'm having trouble modifying the regular expression /^\{.*\}$/ so that a
string with nested curly braces is deemed unmatched. E.g
{recognizing syntax} - matched
{recognizing syntax {foo} bar} - unmatched.
{recognizing syntax {foo{ foo bar}} {bar}} - unmatched.
Can this be done?
Cheers!
use warnings;
use strict;
while (<>) {
chomp;
if (/^\{.*\}$/) {
print "Matched: |$`<$&>$'|\n";
} else {
print "No match.\n";
}
}
I'm having trouble modifying the regular expression /^\{.*\}$/ so that a
string with nested curly braces is deemed unmatched. E.g
{recognizing syntax} - matched
{recognizing syntax {foo} bar} - unmatched.
{recognizing syntax {foo{ foo bar}} {bar}} - unmatched.
Can this be done?
Cheers!
use warnings;
use strict;
while (<>) {
chomp;
if (/^\{.*\}$/) {
print "Matched: |$`<$&>$'|\n";
} else {
print "No match.\n";
}
}