regex question

Hi all i have a problem in the regular expression.. plz help

$a = "<a:1>\nb\nef\n</a>\n<a:2>\nb\n</a>\n<a:3>\nb\n</a>";

My problem is to remove <a:1>\nb\nef\n</a> from the string, facing problem in creating the non greedy regex for this. This cod contain n number of lines between <a:1> and </a>

Thanks


LVL 1
gourav_jainAsked:
Who is Participating?
 
xaniusCommented:
Hi!
$a =~ s/<a:1>.*?</a>//s;

replaces the first occuring <a:1< ... </a> from $a.

Xanius
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.