Menu

#1045 bug in rxregexp when using alternatives

5.0.0
closed
Erich
none
5
2023-01-01
2012-02-09
Anonymous
No

given str1 = " AA2012 " and str2 = " BB2012 "
the following regexp finds a hit in str2 but is failing to find a hit in str1
RE1 = "(AA|BB)[:SPACE:]*[:DIGIT:]"

however the following equivalent regexp does find a hit in both str1 and str2:
RE2 = "(AA[:SPACE:]|BB[:SPACE:])[:DIGIT:]"

testcase attached.

C:>rexx -v
Open Object Rexx Version 4.1.0
Build date: Dec 5 2010
Addressing Mode: 32

Discussion

  • Mark Miesfeld

    Mark Miesfeld - 2012-02-10

    Hi,

    Thanks for attaching a test program, especially an actual working test group.

    I'll take a look at this, but I don't understand the reg expr code that well, I might not be able to do anything about it.

     
  • Rick McGuire

    Rick McGuire - 2013-11-22
    • Pending work items: --> none
    • Group: v4.1 --> None
     
  • Erich

    Erich - 2017-12-03
    • status: open --> pending
    • assigned_to: Erich
    • Group: None --> 5.0.0
     
  • Erich

    Erich - 2017-12-03

    Committed code fix with revision [r11336].
    Also added test cases, and made a minor rexxref update (the latter requiring another fix with [r11337]).

     

    Related

    Commit: [r11336]
    Commit: [r11337]

  • Erich

    Erich - 2017-12-04

    Committed revision [r11338] to fix a hang on Linux caused by [r11336]

     

    Related

    Commit: [r11336]
    Commit: [r11338]

  • Rony G. Flatscher

    • Status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel