![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PERL - copy fiel contents to array then compare against other file | bradleykins | Shell Programming and Scripting | 9 | 03-12-2009 10:51 AM |
| Display the contents of an array | RossMc | UNIX for Dummies Questions & Answers | 1 | 10-31-2008 01:25 PM |
| Perl: array, assigning multi-word sentences with quotes | gctaylor | Shell Programming and Scripting | 4 | 09-05-2008 03:11 PM |
| How to get exact match sentences? | vanitham | Shell Programming and Scripting | 19 | 08-23-2008 12:43 AM |
| How to get only matched contents? | vanitham | Shell Programming and Scripting | 1 | 11-13-2007 10:02 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to match all array contents and display all highest matched sentences in perl?
Hi, I have an array with 3 words in it and i have to match all the array contents and display the exact matched sentence i.e all 3 words should match with the sentence. Here are sentences. Code:
$arr1="Our data suggests that epithelial shape and growth control are unequally affected depending on how wt p53 function is impaired and whether partial or full tumor suppressor activity is lost"; $arr2="The growth of epithelial tissue is downregulation"; I want all there 3 words to be matched and that sentence has to printed first. Here are the words. I tried like this: Code:
$array="epithelial,growth,downregulation";
@split=split(",",$array);
foreach $word(@split)
{
if($arr1=~/\b$word\b/i || $arr2=~/\b$word\b/i)
{
print "<br> Matched <br>";
}
}
Just stuck up here!! The output should be like this: Code:
The growth of epithelial tissue is downregulation Our data suggests that epithelial shape and growth control are unequally affected depending on how wt p53 function is impaired and whether partial or full tumor suppressor activity is lost How can i match all these words and print the sentence with highest match (all the words matching the sentence) in perl?? Any idea??? Regards Vanitha |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|