[tpm] Regex question

Uri Guttman uri at stemsystems.com
Tue Nov 6 11:38:37 PST 2007

>>>>> "DS" == Daniel Son <dsong at meta-for.org> writes:

  DS> Sorry, the reply went not to the group, but as personal response. In 
  DS> this one:

  DS> $x =~ s/^foo.*\n?//gm;

  DS> the last ? will ensure that the last line will be matched if there is no 
  DS> new line

that is what $ does already. $ matches a newline or the end of the
string. and with /m it matches internal newlines.


Uri Guttman  ------  uri at stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

More information about the toronto-pm mailing list