in reply to Re: @ ergular expression
in thread @ ergular expression
Hi, I tried to implement what you have asked me to do but it;s printing nothing
The Part of code is as follows
#!/usr/bin/perl -w use strict; #The below variable $mystring is used for some other example my $mystring = "http://192.168.153.238/nightly_results/2009_12_02/log_ +lcla114.lss.emc.com_64___TestSuitePPAll_TestSuitePPSym_TestSuitePPper +f_TestSuitePPTx_TestSuitePPConCurrent_Prod_SymmSLV_AIX__3_15.html"; my $sample_sentence = "The kernel bitness: 64"; # ----------- The code corresponds to $mystring ------------# if($mystring =~ m/nightly_results(.*?)(.html)/) { my $web_link= "/nightly_db".$1; print $web_link; } if($mystring =~ m!([^/]+)$!){ my $file=$1; print "field= $file\n"; } #-----------Code ends corresponds to $myString -------------# #----------------- code corresponds to $sample_sentence -----------# print $sample_sentence =~ /kernel bitness:\s(\d*)/; #------------- COde ends here b--------------------#
I was trying to implement $mystring code in the case $sample_sentence as well.But I could not able to display the Appropriate output
Can you do one favor on me in order to extract the desired output ? Because the solution you asked me to implement is not working properly
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: @ ergular expression
by kennethk (Abbot) on May 13, 2010 at 20:35 UTC | |
by siddheshsawant (Sexton) on May 13, 2010 at 20:59 UTC |