Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: help needed to solve in regex

by diotalevi (Canon)
on Jan 10, 2007 at 05:59 UTC ( [id://593836]=note: print w/replies, xml ) Need Help??


in reply to Re: help needed to solve in regex
in thread help needed to solve in regex

You forgot the surround the pattern with \b markers.

/\b\Q$find\E\b/

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Replies are listed 'Best First'.
Re^3: help needed to solve in regex
by ikegami (Patriarch) on Jan 10, 2007 at 06:26 UTC
    oh, I didn't notice that matched the third line. Unforunately, I don't agree with your solution. That is to say I don't think we can provide a solution with the information he provided us. For example, all of the following match his criteria, yet all are different:
    • /\b\Q$find\E\b/
    • /(?<!\S)\Q$find\E/(?!\S)
    • /\Q$find\E/(?!\.)
    • /\Q$find\E$/
    • /\Q$find\E$/m
    • /\Q$find\E\z/
    • ...

    The op should have a look at perlre. (Or should I say "another look" since he should already have looked there when he started having problems with his regexp...)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-25 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found