Re: [pcre-dev] /x modifier bug when using # comments in RE ?

Top Page
Delete this message
Author: GAUTIER Herve
Date:  
To: pcre-dev@exim.org
Subject: Re: [pcre-dev] /x modifier bug when using # comments in RE ?

Additional information.
The library 8.34 is compiled with following options:
PCRE_CONFIGURE_OPTS =
PCRE_CONFIGURE_OPTS += --prefix=$(PCRE_OBJROOT)
PCRE_CONFIGURE_OPTS += --disable-shared
PCRE_CONFIGURE_OPTS += --disable-cpp
PCRE_CONFIGURE_OPTS += --enable-jit
PCRE_CONFIGURE_OPTS += --enable-newline-is-crlf
PCRE_CONFIGURE_OPTS += --enable-pcretest-libreadline
CFLAGS='-O2 -Wall' ./configure $(PCRE_CONFIGURE_OPTS)

With an older version (installed by default on my system):

$ pcretest
PCRE version 6.6 06-Feb-2006

re> /^

    >               [+-]?
    >               (
    >                       \d+\.\d+
    >                     |\d+\.
    >                    |\.\d+
    >              )
    >              ([eE][+-]?\d+)?
    >        [\r]*$/xm

data> START\r\n1.2E3\r\nEND

0: 1.2E3\x0d
1: 1.2
2: E3
data>
re> /^

    >                [+-]? # test
    >                (
    >                        \d+\.\d+
    >                      |\d+\.
    >                     |\.\d+
    >               )
    >               ([eE][+-]?\d+)?
    >         [\r]*$/xm

data> START\r\n1.2E3\r\nEND

0: 1.2E3\x0d
1: 1.2
2: E3
data> START\n1.2E3\nEND

0: 1.2E3
1: 1.2
2: E3
data>

On 05/06/2014 17:23, GAUTIER Herve wrote:


Hello world !

I seems I have detected a strange behaviour when using the /x modifier
with # comments in the RE

$CTUOBJ/pcre/bin/pcretest
PCRE version 8.34 2013-12-15

   re> /^
     >             [+-]?
     >             (
     >                     \d+\.\d+
     >                   |\d+\.
     >                   |\.\d+
     >             )
     >             ([eE][+-]?\d+)?
     >       [\r]*$/xm

data> START\r\n1.2E3\r\nEND

  0: 1.2E3
  1: 1.2
  2: E3
data>
   re> /^
     >              [+-]? # test
     >              (
     >                      \d+\.\d+
     >                    |\d+\.
     >                    |\.\d+
     >              )
     >              ([eE][+-]?\d+)?
     >        [\r]*$/xm

data> START\r\n1.2E3\r\nEND

0:
data>


Someone can confirm me the problem ?

--
Hervé

--
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev


--
Hervé