Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Unrecognized escape \Q passed through in regex

by ikegami (Patriarch)
on Jan 26, 2006 at 18:33 UTC ( #525803=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Text.
    $text = 'Renata';
    $window =~ /\b\Q$text\E\b/ism
    
  2. or download this
    # Uncompiled regexp.
    $text = 'Renata';
    $regexp = '\\b' . quotemeta($text) . '\\b';
    $window =~ /$regexp/ism
    
  3. or download this
    # Compiled regexp.
    $regexp = qr/\b\QRenata\E\b/ism;
    $window =~ $regexp
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2022-05-22 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?