I am trying to match parentheses by puting the parentheses in a character class, but I cannot get it to work. Here is the sample code I am trying to run:
$line = 'hello(()())';
$line =~ /([\(\)]*)/;
print $1."\n";
I would think '(()())' will get printed, but it does not.
Any help/tips will be much appreciated.
Thanks.
$line = 'hello(()())';
$line =~ /([\(\)]*)/;
print $1."\n";
I would think '(()())' will get printed, but it does not.
Any help/tips will be much appreciated.
Thanks.