replacing

L

Laszlo

Hi Perl gurus

I have a lot of jsp files where I have to replace all old tags with new tags.
Example:

the old tag: "<jsp:directive.page contentType="text/html;charset=iso-8859-2"/>"
the new tag: "<%@ page contentType="text/html;charset=iso-8859-2" %>"

My question is:

How should I write that regular expression which will do the job ?

Thank you.
 
P

Peter Jones

(e-mail address removed) (Laszlo) wrote in
the old tag: "<jsp:directive.page
contentType="text/html;charset=iso-8859-2"/>" the new tag: "<%@ page
contentType="text/html;charset=iso-8859-2" %>"

My question is:

How should I write that regular expression which will do the job ?

s/<jsp:directive\.(.*)\/>/<%@ $1 %>/gi;

(Won't need the final 'i' if all your "jsp:..." are lower case.)

HTH,
Pete.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top