jed-users mailing list

[2021 Date Index] [2021 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[jed-users] Re: pcre_matches - shouldn't PCRE_DOTALL match newlines?


Hi John,

Wonderful, it works now!

If you're the administrator of the mailing list, may I ask you
to remove the address "mbj@xxxxxxxxxxx"? Currently I am
subscribed with two addresses and I can't unsubscribe the
spamcop one, since my relay host only accepts mails from my own
domain, mbjnet.dk

Thanks,
Morten

John E. Davis <jed@xxxxxxxxxxx> wrote:

> Hi Morten,
> 
> Morten Bo Johansen <mbj@xxxxxxxxx> wrote:
> > Hi
> >
> > If I have a multiline string, str = "abc\nabc", and do
> >
> >   str = pcre_matches(".*", str; PCRE_DOTALL);
> >   
> > I would expect "str[0]" to be the same "abc\nabc", but I only
> > get "abc".
> 
> You discovered a bug in pcre.sl.  Here is a patch:
> 
> diff --git a/modules/pcre.sl b/modules/pcre.sl
> index fc062f4..b9ef467 100644
> --- a/modules/pcre.sl
> +++ b/modules/pcre.sl
> @@ -25,7 +25,7 @@ Qualifiers:\n\
>     if (typeof (re) != PCRE_Type)
>       {
>         variable compile_options = qualifier ("options", 0);
> -       re = pcre_compile (re, options);
> +       re = pcre_compile (re, compile_options);
>       }
> 
> Also note that the calling syntax you want is:
> 
>   str = pcre_matches(".*", str; options=PCRE_DOTALL);
> 
> Thanks,
> --John
> 
> >
> > This also happens without PCRE_DOTALL, so it doesn't seem to
> > have any effect. Is my syntax wrong?
> >
> > How do I match all characters in a whole string across lines
> > with pcre_matches()?
> >
> > Thanks,
> > Morten
> > _______________________________________________
> > For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
> >
> _______________________________________________
> For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
> 
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


[2021 date index] [2021 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]