Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Escaping quotemeta() in regex

by ikegami (Pope)
on Nov 30, 2005 at 16:34 UTC ( #512988=note: print w/replies, xml ) Need Help??


in reply to Escaping quotemeta() in regex

That doesn't really make any sense. Does
\dir\d\file.txt
mean
\\dir\\d\\file\.txt
or
\dir\d\\file.txt
or something else?
There's no way to tell what the user meant. There's a reason why regexp provide an escape character: It is required.

Replies are listed 'Best First'.
Re^2: Escaping quotemeta() in regex
by sweetblood (Parson) on Nov 30, 2005 at 17:12 UTC
    Exactley, this is why I ask if there may be someway to tell quotemeta the this protion of the string should not be escaped because it contains valid expression metacharacters.

    Sweetblood

      What distinguishes the portion that should be escaped from the portion that shouldn't be?
        That's my question :)

        Sweetblood

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://512988]
help
Chatterbox?
[TStanley]: I'm sitting in the airport in Tampa, Florida at the moment, getting ready to head home.
[talexb]: TStanley I'm flying to Vegas in two weeks time. After that flights leaving Vegas and Phoenix are late at night .. I've been hearing that it gets so hot that the air isn't dense enough for planes to take off. Weird. Guess you won't have that problem.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2017-06-23 14:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (548 votes). Check out past polls.