I want to parse the image value and the image tag should not be inside the story tag.$str = "<story> <page> <description> desc </description> <image> notExpected.jpg </image> <headline> head </headline> </page> </story> <image>correctImage.jpg</image> "; $str =~ m/[^<story>].*?<image>(.*?)<\/image>.*?[^<\/story>]/s; print $1;
In reply to REGEX issue by siva kumar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |