Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

phrase match

by newbio (Beadle)
on Dec 12, 2009 at 23:25 UTC ( [id://812554]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @phrases = ( 'kinase i', 'hib', 'tor', 'tor SET6', 'SET6', 'p16(INK
    +4A)', 'cell' );
    $sentence='kinase inhibitor SET6 activates p16(INK4A) in cell-wall.';
    ...
    #I am trying to solve like this:
    my $phrases_re = join '|', map { quotemeta } @phrases;
    $sentence =~ s/($phrases_re)/\#$1\#/g;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found