Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Second Time Replace Regex

by JediWizard (Deacon)
on Dec 02, 2005 at 17:37 UTC ( #513735=note: print w/replies, xml ) Need Help??


in reply to Re: Second Time Replace Regex
in thread Second Time Replace Regex

Correct me if I'm wrong but . . . My understanding is that \Q and \E would not be needed in the regex if you quotemeta $P, or vise versa (quotemeta is not needed if you use \Q .. \E). From quotemeta:

quotemeta
Returns the value of EXPR with all non-"word" characters backslashed. (That is, all characters not matching /A-Za-z_0-9/ will be preceded by a backslash in the returned string, regardless of any locale settings.) This is the internal function implementing the \Q escape in double-quoted strings.

If EXPR is omitted, uses $_ .


They say that time changes things, but you actually have to change them yourself.

—Andy Warhol

Replies are listed 'Best First'.
Re^3: Second Time Replace Regex
by ikegami (Pope) on Dec 02, 2005 at 17:40 UTC

    I accidently updated prematurely. You saw bad code I had there for 5s. quotemeta plus \Q...\E would indeed give incorrect results.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2021-06-23 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (121 votes). Check out past polls.

    Notices?