Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > perl regular expression help

Reply
Thread Tools

perl regular expression help

 
 
uttamhoode@gmail.com
Guest
Posts: n/a
 
      08-07-2006
hi all,
i have around 100 perl CGI scripts in which i want to delete some
string.

String is $abc::message{M001} i want to remove $abc::message{ } so
that the string becomes M001.

if i get regular expression for the above i will change the files using
PERL command line

Regards,
uttam hoode

 
Reply With Quote
 
 
 
 
anno4000@radom.zrz.tu-berlin.de
Guest
Posts: n/a
 
      08-07-2006
<(E-Mail Removed)> wrote in comp.lang.perl.misc:
> hi all,
> i have around 100 perl CGI scripts in which i want to delete some
> string.
>
> String is $abc::message{M001} i want to remove $abc::message{ } so
> that the string becomes M001.
>
> if i get regular expression for the above i will change the files using
> PERL command line


So what have you tried and how does it fail to do what you want?

Anno
 
Reply With Quote
 
 
 
 
uttamhoode@gmail.com
Guest
Posts: n/a
 
      08-07-2006
got the solution

perl -pi -w -e 's/\$abc::message{(\D\d\d\d)}/$1/g;' *.cgi

this will replace all $abc::message{xxx} to xx

before it didnt work because i gave escape sequence to some special
charatcers

.....like this

perl -pi -w -e 's/\$abc\:\:message\{(\D\d\d\d)\}/$1/g;' *.cgi

Regards,
uttam hoode


http://www.velocityreviews.com/forums/(E-Mail Removed)-berlin.de wrote:

> <(E-Mail Removed)> wrote in comp.lang.perl.misc:
> > hi all,
> > i have around 100 perl CGI scripts in which i want to delete some
> > string.
> >
> > String is $abc::message{M001} i want to remove $abc::message{ } so
> > that the string becomes M001.
> >
> > if i get regular expression for the above i will change the files using
> > PERL command line

>
> So what have you tried and how does it fail to do what you want?
>
> Anno


 
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
Seek xpath expression where an attribute name is a regular expression GIMME XML 3 12-29-2008 03:11 PM
Matching abitrary expression in a regular expression =?iso-8859-1?B?bW9vcJk=?= Java 8 12-02-2005 12:51 AM
Help with a Perl Regular Expression Eric B. Perl 1 12-17-2004 10:56 PM
Help needed: cryptic perl regular expression in python syntax pekka niiranen Python 5 10-20-2004 12:39 PM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM



Advertisments