• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 278
  • Last Modified:

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


0
gourav_jain
Asked:
gourav_jain
1 Solution
 
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.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now