[Pharo-dev] [Glass] Bug in Regex?

Mariano Martinez Peck marianopeck at gmail.com
Thu Feb 21 07:40:53 EST 2019


Vassili Bykov Hi Max,

It looks like it was fixed on a later version of VBRegex. I was able to
extract the 2 little changes to make it work. Do you know if there is an
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 the
original implementation was done by Vassili Bykov and the packages were
called VBRegex and that was in VW under the Public Store. I guess, at some
point, that code was ported to Pharo. In Pharo 1.1 the packages are still
called 'VB-Regex' but on recent ones its called "Regex".

What I cannot confirm is which version Pharo (or maybe this was even en
Squeak before Pharo forked) ported from VW.  All I could find is a class
comment on RxMatcher saying "-- Regular Expression Matcher v 1.1 (C) 1996,
1999 Vassili Bykov". As  you can see, that is 1999. VW has newer versions
from 1.2.x to 1.4.x, latest commit being on 2014.

The particular problem we are discussing in this thread was fixed in
1.3.1.

So I am not sure if someone ever tried porting again a newer version to
Pharo? It doesn't seem the case.

Anyone knows a bit more the history here?

Thanks


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 to
> VBRegex that is). The bug is simple to work around though, as all you have
> to do is sort your branch (|) terms by length. Here's the comment I've
> written for a regex generating method is use:
>
> " The sorting is very important because VB-Regex aborts early on branches.
> Example: 'bl' matchesRegex: 'b|bl' --> false The solution is to sort by
> length (longest first), then alphabetically, with the short group
> optimization at the end. "
>
> Cheers,
> Max
>
> 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 RX
>> tree ;)
>>
>>
> Oh yeah..And look Doru, they have some stuff on the top right
> "Explanation" panel: https://regex101.com/r/MqVXz8/1
>
>
> --
> Mariano
> https://twitter.com/MartinezPeck
> http://marianopeck.wordpress.com
>
>

-- 
Mariano
https://twitter.com/MartinezPeck
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20190221/94505216/attachment.html>


More information about the Pharo-dev mailing list