venkatr_n has asked for the wisdom of the Perl Monks concerning the following question:
Sometimes the Other ... line can be missing, and the output ends with the T .... line. I'm trying to extract four values from this:# Output from 'compseq' # # The Expected frequencies are calculated on the (false) assumption th +at every # word has equal frequency. # # The input sequences are: # 2L Word size 1 Total count 48795086 # # Word Obs Count Obs Frequency Exp Frequency Obs/Exp Freque +ncy # A 13340410 0.2733966 0.2500000 1.0935 +864 C 10686861 0.2190151 0.2500000 0.8760 +604 G 10692025 0.2191209 0.2500000 0.8764 +838 T 13352116 0.2736365 0.2500000 1.0945 +460 Other 723674 0.0148309 0.0000000 10000000000.00 +00000
, where I'm trying to allow for the fact the Other... line might not be found in $compseqOutput. For some reason, it fails when I have this -- it works perfectly when the expression is$compseqOutput =~ m/Total\scount\s+(\d+).+? C\s+(\d+).+? G\s+(\d+).+? (?:Other\s+(\d+))?/sx
, but obviously that doesnt do what I want it to. I know I can get around this in many ways, but why does this not work?$compseqOutput =~ m/Total\scount\s+(\d+).+? C\s+(\d+).+? G\s+(\d+).+? Other\s+(\d+)/sx
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular Expn Problem
by Roy Johnson (Monsignor) on May 10, 2004 at 03:35 UTC | |
by venkatr_n (Sexton) on May 10, 2004 at 06:01 UTC | |
|
Re: Regular Expn Problem
by BrowserUk (Patriarch) on May 10, 2004 at 03:36 UTC | |
by TilRMan (Friar) on May 10, 2004 at 08:25 UTC | |
by venkatr_n (Sexton) on May 10, 2004 at 06:05 UTC | |
by BrowserUk (Patriarch) on May 10, 2004 at 06:49 UTC | |
|
Re: Regular Expn Problem
by graff (Chancellor) on May 10, 2004 at 03:41 UTC | |
by venkatr_n (Sexton) on May 10, 2004 at 06:00 UTC | |
|
Re: Regular Expn Problem
by TilRMan (Friar) on May 10, 2004 at 08:07 UTC | |
|
Re: Regular Expn Problem
by Roy Johnson (Monsignor) on May 10, 2004 at 11:44 UTC |