Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Escaping quotemeta() in regex

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


in reply to Re^2: Escaping quotemeta() in regex
in thread Escaping quotemeta() in regex

What distinguishes the portion that should be escaped from the portion that shouldn't be?


Comment on Re^3: Escaping quotemeta() in regex
Re^4: Escaping quotemeta() in regex
by sweetblood (Parson) on Nov 30, 2005 at 18:28 UTC
    That's my question :)

    Sweetblood

      My first post in this thread pointed out there is NO inherent distinction. Any distinction would have to be imposed by you, the designer. Any distinction we come up with would be arbitrary and thus have limitations, so we can't answer your question.

      We really can't help you until you explain what \dth\d\file.txt should become.

      • Should the first "\" should be escaped?
        • Yes? What if the user wants to match "4th..." and "5th...", but not "\dth..."?
        • No? What if the user wants to match "\dth...", but not "4th..." and "5th..."?
      • Should the second "\" should be escaped?
        • Yes? What if the user wants to match "...th4..." and "...th5...", but not "...th\d..."?
        • No? What if the user wants to match "...th\d...", but not "...th4..." and "...th5..."?
      • Should the "." should be escaped?
        • Yes? What if the user wants to match "...file_txt"?
        • No? What if the user doesn't want to match "...file_txt"?

      We can show you how if you tell us what you want, but you haven't given us nearly enough information.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2014-09-22 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls