Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re... quick question about parentheses and regular expressions

by Roy Johnson (Monsignor)
on Nov 04, 2003 at 18:08 UTC ( [id://304494]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $line = 'She was very absorbed in her homework.';
    my $word = 'absorb';
    ...
    $_=$line;
    s/ ($word)//ig;
    print "\$1 is $1\n";
    
  2. or download this
    #This also fails
    s/(\b$word)//ig;
    ...
    #or EVEN THIS!
    my $pat = qr/$word/;
    s/\b($word)//gi;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found