Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: "exact" pattern matching

by my_nihilist (Sexton)
on Jun 08, 2008 at 21:36 UTC ( [id://690963]=note: print w/replies, xml ) Need Help??


in reply to Re: "exact" pattern matching
in thread "exact" pattern matching

No, I need to use it in a "search and replace" style. I think the only way to do that with "eq" would be to take the length of the string and then compare every segment of that length, advancing thru the data one character at a time. Parsing the string first will be easier.

Tk::text DOES have an "exact" match option (like the ones in your word processor, web browser, etc.) but i then need a way to apply the string from the GUI in searches of files that, for example, have not yet been loaded into the Tk GUI. I do think it's odd that we can't go:
if ($str=~/^?.../E)
where "E" would meaning ignoring special characters -- the equivalent of:
if ($str=~/\^\?\.\.\./)

Replies are listed 'Best First'.
Re^3: "exact" pattern matching
by lima1 (Curate) on Jun 09, 2008 at 11:40 UTC
    What's wrong with index?? And you can of course ignore special chars in a regex.
    $str=~/\Q \E/
    Upps, did not see the posting of moritz...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2025-11-18 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (72 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.