Menu

#16 Can't compile certain pattern

open
nobody
None
5
2005-03-28
2005-03-28
Anonymous
No

Hi,

Just testing out jregex again, and have found that it
can't compile the following pattern:

{(\d+):(([^}](?!-}))*)

The Exception is "malformed quantifier"

This pattern works correct in OROMatcher, GNURegex, and
standard Perl5.

Any ideas?

Damien

Discussion

  • Sergey A. Samokhodkin

    Logged In: YES
    user_id=367459

    Hi!
    Just escaping the curly brace makes the thing work fine:
    \{(\d+):(([^}](?!-}))*)
    Currently I'd suggest you take it as a feature (which if fact it is)
    rather than a bug. It stems from my own idiosyncrasy - I don't
    especially like such frivolous bits in the perlre syntax. Should it be
    fixed?

    P.S. The test case from the oro list also makes no problem.

     
  • Damien Mascord

    Damien Mascord - 2005-03-31

    Logged In: YES
    user_id=373792

    Well, it's not strict perl5 regex, so strictly it goes
    against your feature claim of "Perl5.6 regex" :)

    I did try with the \{ just after I sent this bug report, so
    I can confirm that too.

    In terms of fixing the "issue" I would think it would be
    better to do so, an easy check to see if the character after
    { is a digit, and if not, treat { lie [{] or \{

    Regarding the P.S: I had a production bug report for some of
    our software, and the root cause was ORO. I have
    recommended putting JRegex in place of ORO. [JRegex seems
    to run fine on a 48k stack :) ] , although I had to do a bit
    of work getting our software to work functionally the same
    as GNURegex and ORO.

    Quite impressive with your stability and speed of JRegex!
    Hopefully we won't see any production problems to cause me
    to come running. :)

     

Log in to post a comment.