Skip to content
Tcl Source Code History Of Ticket 838711ffffffffff
Login

History Of Ticket 838711ffffffffff

Artifacts Associated With Ticket 838711ffffffffff

  1. Ticket change [25ae8fa940] (rid 88212) by nobody on 2003-11-09 10:14:00:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Tcl Version :8.4.4
      OS Platform :LINUX red hat 7.3
      Problem Behavior: matching variables are not being set 
      when there is + in the end of the pattern
      
      %regexp -all {([0-9|A-Z]*)} {31MAR+} match var
      2
      %puts $var 
      
      %regexp -all {([0-9|A-Z]*)} {31MAR} match var
      1
      %puts $var 
      31MAR
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "43. Regexp"
    10. title initialized to: "matching variables are not being set correctly"
    11. type initialized to: "Bug"
  2. Ticket change [0967411c49] (rid 89715) by msofer on 2003-11-09 18:48:59:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2003-11-09T11:48:59"
    3. closer changed to: "msofer"
    4. icomment:
      Logged In: YES 
      user_id=148712
      
      There is no bug here?
      
      Look at what is happening if you return both matches inline:
        % regexp -inline -all {([0-9|A-Z]*)} {31MAR+}
        31MAR 31MAR {} {}
        % regexp -indices -inline -all {([0-9|A-Z]*)} {31MAR+}
        {0 4} {0 4} {5 4} {5 4}
      
      This is probably not what the programmer wanted, but it is
      what he requested in the regexp: a sequence of 'ZERO or more
      digits, "|" or caps', and return the matching sequence. Two
      such sequences are found here: "31MAR" (wanted) and a zero
      length one. 
      
      The pattern seems badly specified to me, a proper definition
      of zero-length matches is at least difficult. The correct
      thing would have been to request a sequence of ONE or more
      such symbols (+ instead of *)
        % regexp -inline -all {([0-9|A-Z]+)} {31MAR+}
        31MAR 31MAR
      
      BTW, I can imagine that the wanted regexp is actually
      {([0-9A-Z]+)} - ie, that the symbol "|" should not match -
      but this is second-guessing the submitter.
      
      Assigning to another mainatiner for confirmation of this
      dismissal.
      
      
    5. login: "msofer"
    6. mimetype: "text/plain"
    7. resolution changed to: "Invalid"
    8. status changed to: "Pending"
    9. username: "msofer"
  3. Ticket change [e47ade4849] (rid 87958) by dgp on 2003-11-10 21:55:57:

    1. closedate changed to: "2003-11-10T14:55:57"
    2. closer changed to: "dgp"
    3. foundin changed to: "obsolete: 8.4.4"
    4. icomment:
      Logged In: YES 
      user_id=80530
      
      
      The pattern matches the empty string.
      
      The default "greedy"
      scheme of matching sucks up the
      whole string as the first  match, though.
      Then the trailing empty string is the only
      one left that can match.
      
      Consider:
      % regexp -all -inline {[0-9|A-Z]*} 31MAR+   
      31MAR {}
      
      I see no bug here.
      
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. status changed to: "Closed"
    8. username: "dgp"
  4. Ticket change [26f02983ca] (rid 88434) by dkf on 2003-11-11 02:31:06:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Also consider this:
      %regexp -all -inline {[0-9]+|[A-Z]+} {31MAR+}
      31 MAR
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"