replacing

Discussion in 'Perl' started by Laszlo, Aug 26, 2003.

  1. Laszlo

    Laszlo Guest

    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.
    Laszlo, Aug 26, 2003
    #1
    1. Advertising

  2. Laszlo

    Peter Jones Guest

    (Laszlo) wrote in
    news::

    > 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.
    Peter Jones, Aug 26, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lucky
    Replies:
    11
    Views:
    2,550
    Lucky
    Nov 11, 2005
  2. Salman
    Replies:
    1
    Views:
    411
    Jonathan Bromley
    Apr 5, 2005
  3. Ben Holness
    Replies:
    0
    Views:
    5,419
    Ben Holness
    Jan 6, 2006
  4. John
    Replies:
    2
    Views:
    413
    Victor Garcia Aprea [MVP]
    Jul 7, 2003
  5. Rob Meade

    Replacing - and not Replacing...

    Rob Meade, Apr 5, 2005, in forum: ASP General
    Replies:
    5
    Views:
    255
    Chris Hohmann
    Apr 11, 2005
Loading...

Share This Page