Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > replacing

Reply
Thread Tools

replacing

 
 
Laszlo
Guest
Posts: n/a
 
      08-26-2003
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.
 
Reply With Quote
 
 
 
 
Peter Jones
Guest
Posts: n/a
 
      08-26-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (Laszlo) wrote in
news:(E-Mail Removed) m:

> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing String Using Regular Expression lucky ASP .Net 11 11-11-2005 07:01 AM
Guide: Replacing your North Bridge Heatsink RObErT_RaTh Reviews & How-To's 34 09-08-2005 07:22 AM
Replacing - and not Replacing... Rob Meade ASP General 5 04-11-2005 06:49 PM
Replacing groups of statements Salman VHDL 1 04-05-2005 03:42 PM
Replacing UTP with wireless, what equipment? Joel Dorfan Wireless Networking 2 10-31-2004 12:44 PM



Advertisments