Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: Escaping quotemeta() in regex

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


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

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.


Comment on Re^5: Escaping quotemeta() in regex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-08-22 23:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (168 votes), past polls