Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: regex pattern match

by reaper9187 (Scribe)
on Apr 01, 2013 at 17:42 UTC ( #1026519=note: print w/ replies, xml ) Need Help??


in reply to regex pattern match

Oh .. i'm sorry ,...
The problem was with the regex replacing the directory path within the double quotes.$current_path and $new_path are two variables that i need for substitution.Then i perform a simple regex substitution. However, the double quotes and backslash made it extra hard to perform regex matching .. . The answer may not look great but it works.!!

$line =~s/\Q$current_path/$new_path\E/ig;


Comment on Re: regex pattern match
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026519]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2015-07-29 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (267 votes), past polls