search & replace

  • Thread starter Venkatesh Babu Sira
  • Start date
V

Venkatesh Babu Sira

Greats,

I want to replace basepath=" to basepath="${archive.path}

How can i achieve this.

It would be pretty easy if there are no special characters.

TIA
-Venakt
 
P

Paul Lalli

Venkatesh Babu Sira said:
Greats,

I want to replace basepath=" to basepath="${archive.path}

How can i achieve this.

It would be pretty easy if there are no special characters.

You haven't given anywhere near enough information to help you. You
don't have any actual Perl variables, you haven't told us what method
you're using to determine what needs to be searched, nor what needs to
be the replacement.

Have you read the Posting Guidelines which are posted to this group
regularly?

Regardless, I shall make use of the Psi::ReadMind module to determine
that you want to make use of the quotemeta function, which is usually
used by way of the \Q and \E escape sequences. You can read about at
perldoc -f quotemeta

Paul Lalli
 
T

Tad McClellan

Venkatesh Babu Sira said:
I want to replace basepath=" to basepath="${archive.path}

s/basepath="/\Qbasepath="${archive.path}/;
or
s/basepath="/basepath="\${archive.path}/;


It would be pretty easy if there are no special characters.


It is pretty easy _with_ special characters too, simply
remove their specialness via backslashing.
 

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

No members online now.

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,420
Latest member
ZitaVos505

Latest Threads

Top