[squeak-dev] The Inbox: Regex-Tests-Core-pre.6.mcz

Rein, Patrick Patrick.Rein at hpi.de
Thu May 19 18:55:21 UTC 2016


I would like to comment further on these changes as they change the expected Regex engine behavior. The behavior, that matching groups in a multiple quantifier return the last match of the group is consistent with for example the Ruby regex engine:

http://rubular.com/r/kxoreyPolG

The issue is also decribed here: http://www.regular-expressions.info/captureall.html

However, I am not sure what the intended behavior for RxMatcher is. Has this ever been working and what was the intended behavior?

Bests
Patrick
________________________________________
From: squeak-dev-bounces at lists.squeakfoundation.org <squeak-dev-bounces at lists.squeakfoundation.org> on behalf of commits at source.squeak.org <commits at source.squeak.org>
Sent: Thursday, May 19, 2016 13:50
To: squeak-dev at lists.squeakfoundation.org
Subject: [squeak-dev] The Inbox: Regex-Tests-Core-pre.6.mcz

Patrick Rein uploaded a new version of Regex-Tests-Core to project The Inbox:
http://source.squeak.org/inbox/Regex-Tests-Core-pre.6.mcz

==================== Summary ====================

Name: Regex-Tests-Core-pre.6
Author: pre
Time: 19 May 2016, 8:50:59.559548 pm
UUID: e1cbdf20-9ce2-4e4a-b1d8-574186c2e746
Ancestors: Regex-Tests-Core-ul.5

Adjustments to the Regex tests for optional subexpressions in multiple quantifiers. These tests demonstrate the different behavior when nesting subexpressions in quantifiers and the other way round.

=============== Diff against Regex-Tests-Core-ul.5 ===============

Item was added:
+ ----- Method: RxMatcherTest>>testOptionalMultipleQuantifiedSubexpression (in category 'testing') -----
+ testOptionalMultipleQuantifiedSubexpression
+       <timeout: 0.1>
+
+       self runRegex: #('((aa?){2})'
+               '' false nil
+               'a' false nil
+               'aa' true (1 'aa')
+               'baaa' true (2 'aaa'))!

Item was changed:
  ----- Method: RxMatcherTest>>testOptionalNestedIntoMultipleQuantified (in category 'testing') -----
  testOptionalNestedIntoMultipleQuantified
        <timeout: 0.1>

        self runRegex: #('(aa?){2}'
                '' false nil
                'a' false nil
                'aa' true (1 'aa')
+               'baaa' true (2 'a'))!
-               'baaa' true (2 'aaa'))!



More information about the Squeak-dev mailing list