[Pharo-dev] Bug in Regex?
Mariano Martinez Peck
marianopeck at gmail.com
Wed Feb 20 15:43:59 EST 2019
And..as Esteban Maringolo points out, it also happens with sequence of
'bb' matchesRegex: '([a-z]|[b-z][a-z])' --> false.
Cannot be simpler than this:
'25' matchesRegex: '(\d\d|\d)' --> true
'25' matchesRegex: '(\d|\d\d)' --> false
So there is something related to the OR.
On Wed, Feb 20, 2019 at 5:33 PM Mariano Martinez Peck <marianopeck at gmail.com>
> BTW, I am CCing GemStone mailing list too because it answers false there
> On Wed, Feb 20, 2019 at 5:26 PM Mariano Martinez Peck <
> marianopeck at gmail.com> wrote:
>> Hi guys,
>> Look at this case:
>> `'25' matchesRegex: '([0-9]|[1-9][0-9])' -> false`
>> `'25' matchesRegex: '([1-9][0-9]|[0-9])' -> true`
>> That is, ( a | b ) is not euqal to ( b | a ) " a or b is not equal to b
>> or a" and should describe a range of 0 to 99.
>> I don't understand why the first sentence answers false. Even Pharo 1.1
>> answers false (so this is very very old behavior). I checked on other
>> dialects and it answers true. I then checked here  and it also find
>> So...do you see some rational explanation or sounds like a bug?
>>  https://regex101.com/r/MqVXz8/1
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev