Skip to content
Tcl Source Code History Of Ticket 1080042fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1080042fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1080042fffffffffffffffffffffffffffffffff

  1. Ticket change [81b40f23c5] (rid 117085) by kaitzschu on 2004-12-06 16:02:12:

    1. assignee initialized to: "pvgoran"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Donal K. Fellows advised me to report this as a bug. Summary says it all. Try following (by Arjen Markus)
      
      regexp {(\Y)+} foo
      
      and see it happening.
      
    4. foundin initialized to: "obsolete: 8.4.8"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "kaitzschu"
    9. subsystem initialized to: "43. Regexp"
    10. title initialized to: "\Y can be quantified as (\Y)"
    11. type initialized to: "Bug"
  2. Ticket change [aec51a7212] (rid 143527) by tgl on 2015-10-15 05:32:13:

    1. assignee changed to: "aku"
    2. closer changed to: "nobody"
    3. comment changed to:
      Donal K. Fellows advised me to report this as a bug. Summary says it all. Try following (by Arjen Markus)
      
      regexp {(\Y)+} foo
      
      and see it happening.
      
    4. icomment:
      I've written a fix for this problem.  It's included along with a batch of other regex fixes in this submission to the Postgres project:
      http://www.postgresql.org/message-id/[email protected]
      
      I plan to submit a Tcl-adapted version of this code once it's committed to Postgres, but if anyone would like to help review it right now, please step up.
      
    5. login: "tgl"
    6. mimetype: "text/plain"
    7. severity changed to: "Minor"
  3. Ticket change [3e2352fff5] (rid 143601) by dgp on 2015-10-20 20:23:41:

    1. icomment:
      
      I've now adapted all the patches I found at that link, yet this
      bug still remains.
      
      Is the bug fix really somewhere else?
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  4. Ticket change [cc50d7fc9b] (rid 143602) by tgl on 2015-10-20 23:24:21:

    1. icomment:
      Um ... do we have different ideas of what the bug is?
      
      In 8.6.4 I see
      
      % regexp {(\Y)+} foo
      couldn't compile regular expression pattern: nfa has too many states
      
      Building from commit 8dd308bfed2d855e902aa815eadabbe560d39e2d (tip of tgl-pg-re), I see
      
      % regexp {(\Y)+} foo
      1
      
      which seems like the correct behavior to me.
      
      I did a quick manual comparison of regc_nfa.c from your tree to ours, and I don't see anything that you seem to have missed, except for the stack-depth-checking changes not being there.
      
    2. login: "tgl"
    3. mimetype: "text/plain"
  5. Ticket change [033745a511] (rid 143603) by dgp on 2015-10-21 13:11:54:

    1. icomment:
      
      Ok, what's confusing me is this:
      
      % regexp {(\Y)+} foo
      1
      % regexp {\Y+} foo
      couldn't compile regular expression pattern: quantifier operand invalid
      
      I don't understand why adding the parens converts an RE from
      something invalid into something valid.
      
      I do confirm the changes your report though.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  6. Ticket change [6d63a4b086] (rid 143609) by dgp on 2015-10-21 14:20:09:

    1. icomment:
      
      Fix accepted.  Leaving Pending in case anyone can
      comment and clear up my confusion.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"
  7. Ticket change [44a578c336] (rid 143611) by tgl on 2015-10-21 16:27:25:

    1. icomment:
      > I don't understand why adding the parens converts an RE from
      > something invalid into something valid.
      
      This is pretty key actually: I suspect Henry Spencer may never have considered this sort of situation, because he explicitly disallows quantification of bare constraints in the re_syntax.n man page.  It says in so many words "A constraint may not be followed by a quantifier.", and this is also implicit in the careful distinctions it draws between atoms (which match some amount of text) and constraints (which don't).  However, any legal RE can be enclosed in parentheses, making it an atom, which allows it to be quantified.
      
      I think his rule against quantifying bare constraints is sensible: a constraint either matches or doesn't, there is no point in applying it more than once.  So another way we might possibly have addressed this is to disallow quantification of subexpressions that don't contain at least one non-constraint.  But I'm not quite convinced that that wouldn't break some useful cases, and it probably wouldn't be trivial to implement either.
      
    2. login: "tgl"
    3. mimetype: "text/plain"
  8. Ticket change [5a3487520b] (rid 143620) by dgp on 2015-10-21 17:01:58:

    1. closedate changed to: "2457317.2097053"
    2. closer changed to: "dgp"
    3. icomment:
      
      Thanks for the info.
      
      And thanks for all the improvements too.
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"