in reply to parsing file/regex question

  1. The regular expression doesn't change, so you should notify Perl that it's safe to compile it once,. rather than each time that line is encountered. For two invocations, it obviously doesn't matter, but small scripts have a habit of growing, so you might as well get off to a good start right away:
    if /$PRE($VALID1+)$PST/o
  2. You parenthesize $Valid1 twice, once as the last character of $PRE and the first character of $PST, then explitly when you string them together:
    /$PRE($VALID1+)$PST/.

--
TTTATCGGTCGTTATATAGATGTTTGCA

Replies are listed 'Best First'.
Re: Re: parsing file/regex question
by Anonymous Monk on Oct 24, 2003 at 08:36 UTC
    /o must go (look around for many threads about the /o bug ...)