[Pharo-dev] [Glass] Bug in Regex?
maxleske at gmail.com
Thu Feb 21 08:43:51 EST 2019
On 21 Feb 2019, at 13:40, Mariano Martinez Peck wrote:
> Vassili Bykov Hi Max,
> It looks like it was fixed on a later version of VBRegex. I was able
> extract the 2 little changes to make it work. Do you know if there is
> issue already open for this so that I can submit the changes?
> BTW, I am trying to understand the history of Regex. It's clear that
> original implementation was done by Vassili Bykov and the packages
> called VBRegex and that was in VW under the Public Store. I guess, at
> point, that code was ported to Pharo. In Pharo 1.1 the packages are
> called 'VB-Regex' but on recent ones its called "Regex".
The package name changed between Pharo 1.1.2 and Pharo 1.2.2, as far as
I can tell from the images I have on my machine.
> What I cannot confirm is which version Pharo (or maybe this was even
> Squeak before Pharo forked) ported from VW. All I could find is a
> comment on RxMatcher saying "-- Regular Expression Matcher v 1.1 (C)
> 1999 Vassili Bykov". As you can see, that is 1999. VW has newer
> from 1.2.x to 1.4.x, latest commit being on 2014.
The oldest images I have is Squeak3.9 of 7 November 2006 update 7067,
and that already contains VBRegex.
> The particular problem we are discussing in this thread was fixed in
> So I am not sure if someone ever tried porting again a newer version
> Pharo? It doesn't seem the case.
It would certainly be great to get those fixes!
> Anyone knows a bit more the history here?
> On Thu, Feb 21, 2019 at 5:18 AM Max Leske <maxleske at gmail.com> wrote:
>> Hi Mariano,
>> Yes, there is indeed such a bug (if it hasn't been fixed in an update
>> VBRegex that is). The bug is simple to work around though, as all you
>> to do is sort your branch (|) terms by length. Here's the comment
>> written for a regex generating method is use:
>> " The sorting is very important because VB-Regex aborts early on
>> Example: 'bl' matchesRegex: 'b|bl' --> false The solution is to sort
>> length (longest first), then alphabetically, with the short group
>> optimization at the end. "
>> On 21 Feb 2019, at 3:33, Mariano Martinez Peck wrote:
>> On Wed, Feb 20, 2019 at 5:56 PM Esteban Maringolo via Glass <
>> glass at lists.gemtalksystems.com> wrote:
>>> What a good case to have GToolkit visualizations help debugging this
>>> tree ;)
>> Oh yeah..And look Doru, they have some stuff on the top right
>> "Explanation" panel: https://regex101.com/r/MqVXz8/1
More information about the Pharo-dev