I am trying a regex to extrace a specifig piece string using the below.
my $string = '<School type="content" name="Schoolpage"><section name=" +Graduation"><grade name="Iyear"><!-- Set description for BBCA --><des +cription>'; if($string=~ m/(<section (.*)">?)/) { print "Here :: $1 \n"; }else {print "regex failed";}
Output of the above is :::
Here :: <section name="Graduation"><grade name="Iyear">
What I want is '<section name="Graduation">'.
Please advice.
Thanks in advance
In reply to Regex help reqd by Ananda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |