This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: perl 5.6.1 bug report




neillunn@gunz.com.au wrote:
> > > > > while ( $input =~ /(.*?)#/gsm ) {

> Actually it should be right in all perl 5.6.1 builds. Which leads me to say
> that I am actually not sure which one is the bug, but it is not a "cygwin"
> bug.

> Someone please correct me if I'm wrong on this but I thought (*?) with /s as
> a modifier would never match more than once. In fact, try the same string
> with no newlines and it should only match once.

This is from perlfaq6 - Regexes :

=====
I'm having trouble matching over more than one line. What's wrong?

Here's code that finds everything between START and END in a paragraph:

    undef $/;           # read in whole file, not just one line or
paragraph
    while ( <> ) {
        while ( /START(.*?)END/sm ) { # /s makes . cross line boundaries
            print "$1\n";
        }
    }
=====

Eddy

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]