Re: [ANN] Regex11 version 1.4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Regex11 version 1.4

jtuchel
Hi Michel,

I just made your version of the package available for VA Smalltalk on VASTGoodies.com.

As with all Smalltalk ports, there have been some problems to solve due to platform differences. One of them being Collection>>#contains:, which, as I understand it, is equivalent to anySatisfy:.

So this is not really a big issue I solved it by replacing all sends of #contains: with #anySatisfy: .
But it would of course be easier to keep projects like a regex matcher as portable as possible, and thus make it available for a wider audience.

Please don't get me wrong, this is not about blaming somebody, especially when the methods have been in VBRegex forever, so it is not your fault at all.
I would like to ask if somebody in the VW universe would be willing to change these methods in the "original" implementation next time VBRegex needs fixes or extensions and keep an eye on #contains:. If there is any such thing as a to-do list for VBRegex, could this be put on this list?

I guess we're going to see more and more of these little things. I know I've given up (finishing) ports of code from Pharo in the past, just because they use lots of non-ANSI-methods and this not only makes the port itself harder, but also synchronizing with later fixes. This is sad, especially in the light of the fact that a few years ago, all Smalltalk vendors/projects started putting their heads together and think about portability a bit more. I have the feeling now that each of them have Seaside, this new trend has gone to sleep again.

Joachim



Am 01.05.13 17:48, schrieb Joachim Tuchel:
Michel,

That's great news! 
What is the license of that code?

Joachim



"Bany, Michel" [hidden email] schrieb:



[ANN] Regex11 version 1.4

All,
I have just published  Regex11 version 1.4 the Cincom Public Store Repository.
Compared with previous version (1.3.4) it has the following new features.

    VERSION 1.4 (April 2013)
    1. Support for explicitely numbered repetitions, with 39 tests added
    2. Tests can be fired from the Launcher tools menu
    3. All tests passed
    4. Updated Launcher menu items to enable logging during tests
    5. Enhanced the test tools to collect and re-run test failures
    6. Testing mechanics enhanced to support repeating capturing groups

The documentation contains the following new fragment

    Repetitions can also be represented explicitely using numbers
    - Exactly three occurences: {3}
    - Two to five occurences: {2,5}
    - Three or more occurences: {3,}
    - Zero, one or two occurences: {,2}

            'abbbc' matchesRegex: 'ab{3}c'          -- true
            'abc' matchesRegex: 'ab{2,5}c'          -- false: need at least two b
            'abbbbbbc' matchesRegex: 'ab{2,5}c'     -- false: may not have more than five b
            'abbbc' matchesRegex: 'ab{2,5}c'                -- true
            'abbbbbbc' matchesRegex: 'ab{3,}c'      -- true
            'ac' matchesRegex: 'ab{,2}c'            -- true

Feedback is welcome. Depending on the feedback, Cincom may include this new version on the release media.

Enjoy,
Michel.

__________________________________________
Michel Bany
Cincom Systems S.A.
Cours des Bastions 3 bis
1205 Genève

Switzerland
Tel.    +41 (0) 223 105 879
Skype   +33 (0) 970 444 870
Mobile  +33 (0) 608 933 306

Skype   michel.bany
http://www.cincom.com/smalltalk
[hidden email]



All, 
I have just published  Regex11 version 1.4 the Cincom Public Store Repository <http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Public+Store+Repository> .
Compared with previous version (1.3.4) it has the following new features.

	VERSION 1.4 (April 2013)
	1. Support for explicitely numbered repetitions, with 39 tests added
	2. Tests can be fired from the Launcher tools menu
	3. All tests passed
	4. Updated Launcher menu items to enable logging during tests
	5. Enhanced the test tools to collect and re-run test failures
	6. Testing mechanics enhanced to support repeating capturing groups

The documentation contains the following new fragment

	Repetitions can also be represented explicitely using numbers
	- Exactly three occurences: {3}
	- Two to five occurences: {2,5}
	- Three or more occurences: {3,}
	- Zero, one or two occurences: {,2}

		'abbbc' matchesRegex: 'ab{3}c'	 	-- true
		'abc' matchesRegex: 'ab{2,5}c'	 	-- false: need at least two b
		'abbbbbbc' matchesRegex: 'ab{2,5}c'	-- false: may not have more than five b
		'abbbc' matchesRegex: 'ab{2,5}c'		-- true
		'abbbbbbc' matchesRegex: 'ab{3,}c'	-- true
		'ac' matchesRegex: 'ab{,2}c'		-- true

Feedback is welcome. Depending on the feedback, Cincom may include this new version on the release media.

Enjoy,
Michel.

__________________________________________
Michel Bany
Cincom Systems S.A.
Cours des Bastions 3 bis
1205 Genève
Switzerland
Tel.  	+41 (0) 223 105 879
Skype	+33 (0) 970 444 870
Mobile	+33 (0) 608 933 306
Skype	michel.bany
http://www.cincom.com/smalltalk
[hidden email]


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          [hidden email]
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Regex11 version 1.4

Niall Ross
Dear Joachim,
    the latest trunk (1.4.3) of this goodie is in the OR.  If you
publish a version with ANSI #anySatisfy: instead of #contains: (and any
other fixes you recommend), it could be reviewed for inclusion in/as a
future trunk.

             Thanks
                Niall Ross
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Regex11 version 1.4

Steven Kelly
Dear Niall (or really jkott, who is presumably a Cincom colleague?)

I hadn't noticed 1.4.3 before. Thanks for the addition. It looks a little
unfinished to be considered the current trunk head: the version comment says
just:
69706: "[SiouX] - Make WelcomeResponder friendly to non-html content"
and the code changes look a little ad hoc. Maybe they make more sense in the
context of a wider project, presumably SiouX, rather than being obvious
extensions that fit in with Regex11 and extend it for all its users.

Does RxMatcher need to implement asRegex and asRegexIgnoringCase? For the
latter in particular it seems surprising that it just returns self, rather
than making case be ignored. This breaks the idempotency I'd have expected,
in that the following give different results:

'foo' asRegex asRegexIgnoringCase
'foo' asRegexIgnoringCase asRegex

The use of \0, \1 etc. in the replacement string doesn't seem to match Ruby's
documentation, in that it allows numbers past \9. I think the limit to \9 was
probably a conscious decision in Ruby, to prevent ambiguity between '\10'
meaning "first match plus a zero" versus "tenth match".
http://stackoverflow.com/questions/1400937/more-than-9-backreferences-in-gsub
As the last answer there shows, some languages allow just \0 to \9, a few
also \10 to \99. The latter seem to have things like named or numbered
groups, which can be used where necessary to avoid ambiguity; we don't have
those (yet).

Maybe these could be cleaned up in a 1.4.4? The replace methods could also do
with a little code review, e.g.
        block numArgs = 1
                ifTrue: [block value: match]
                ifFalse: [block value: match value: matcher]].
could be simply:
        block cull: match cull: matcher.
which also copes with a block without any arguments (a rare but possible
case, e.g. [readStream next]).

Since I'm a little unsure of the context, I haven't simply published a
clean-up of this, but I attach my efforts for your review. I think it's
better that we don't have keyword arguments called 'string' that can also be
blocks, so I separated out the string-to-block conversion. It would also be
good to add a test and documentation (both on the class side of RxParser).
And feel free to ANSIfy!

All the best,
Steve


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Niall Ross
> Sent: Friday, March 14, 2014 6:21 PM
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: [vwnc] [ANN] Regex11 version 1.4
>
> Dear Joachim,
>     the latest trunk (1.4.3) of this goodie is in the OR.  If you
> publish a version with ANSI #anySatisfy: instead of #contains: (and any
> other fixes you recommend), it could be reviewed for inclusion in/as a
> future trunk.
>
>              Thanks
>                 Niall Ross
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Regex11.1.4.3+.st (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Regex11 version 1.4

jtuchel
In reply to this post by Niall Ross
Hi Niall,

I'm getting an error when I try to republish to the PR. Either I never
had a password to publish to the Repository or I never had one... How
can I get a new one?

So I'm attaching a Fileout of a version 1.4.3,jkott which sends
anySatisfy: instead of contains:. I haven't changed anything else. So if
you could push it onto the Server for me, that would be nice. If you let
me know how to get a new password, I can push it as well.

I am a bit offline with VisualWorks at the moment, still on 7.9.
There, the menu items in the Tools Menu for the Regex tests don't work,
but running the tests from the Package comments says "ALL TESTS PASSED".

Joachim





Am 14.03.14 17:20, schrieb Niall Ross:
> Dear Joachim,
>    the latest trunk (1.4.3) of this goodie is in the OR.  If you
> publish a version with ANSI #anySatisfy: instead of #contains: (and
> any other fixes you recommend), it could be reviewed for inclusion
> in/as a future trunk.
>
>             Thanks
>                Niall Ross
>


--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:[hidden email]
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Regex11_1.4.4_jtu.st (244K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Regex11 version 1.4

jtuchel
Hi List,

I have published a new "version" of Regex11 (version 1.4.3.1), blessed for review, which doesn't send confirms: any more, but anySatisfy: instead. I hope you find the change useful/harmless enough to integrate it into the main branch. This would make later ports to VA and other dialects easier.

Joachim

Am 15.03.14 21:33, schrieb [hidden email]:
Hi Niall,

I'm getting an error when I try to republish to the PR. Either I never had a password to publish to the Repository or I never had one... How can I get a new one?

So I'm attaching a Fileout of a version 1.4.3,jkott which sends anySatisfy: instead of contains:. I haven't changed anything else. So if you could push it onto the Server for me, that would be nice. If you let me know how to get a new password, I can push it as well.

I am a bit offline with VisualWorks at the moment, still on 7.9.
There, the menu items in the Tools Menu for the Regex tests don't work, but running the tests from the Package comments says "ALL TESTS PASSED".

Joachim





Am 14.03.14 17:20, schrieb Niall Ross:
Dear Joachim,
   the latest trunk (1.4.3) of this goodie is in the OR.  If you publish a version with ANSI #anySatisfy: instead of #contains: (and any other fixes you recommend), it could be reviewed for inclusion in/as a future trunk.

            Thanks
               Niall Ross





_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          [hidden email]
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Regex11 version 1.4

Niall Ross
Dear Joachim,
    I'm back from holiday, have added this to AR 60421 and it will be in
8.0.

             Thanks
                   Niall Ross

> Hi List,
>
> I have published a new "version" of Regex11 (version 1.4.3.1), blessed
> for review, which doesn't send confirms: any more, but anySatisfy:
> instead. I hope you find the change useful/harmless enough to
> integrate it into the main branch. This would make later ports to VA
> and other dialects easier.
>
> Joachim
>
> Am 15.03.14 21:33, schrieb [hidden email]:
>
>> Hi Niall,
>>
>> I'm getting an error when I try to republish to the PR. Either I
>> never had a password to publish to the Repository or I never had
>> one... How can I get a new one?
>>
>> So I'm attaching a Fileout of a version 1.4.3,jkott which sends
>> anySatisfy: instead of contains:. I haven't changed anything else. So
>> if you could push it onto the Server for me, that would be nice. If
>> you let me know how to get a new password, I can push it as well.
>>
>> I am a bit offline with VisualWorks at the moment, still on 7.9.
>> There, the menu items in the Tools Menu for the Regex tests don't
>> work, but running the tests from the Package comments says "ALL TESTS
>> PASSED".
>>
>> Joachim
>>
>>
>>
>>
>>
>> Am 14.03.14 17:20, schrieb Niall Ross:
>>
>>> Dear Joachim,
>>>    the latest trunk (1.4.3) of this goodie is in the OR.  If you
>>> publish a version with ANSI #anySatisfy: instead of #contains: (and
>>> any other fixes you recommend), it could be reviewed for inclusion
>>> in/as a future trunk.
>>>
>>>             Thanks
>>>                Niall Ross
>>>
>>
>>
>>
>>
>> _______________________________________________
>> vwnc mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>vwnc mailing list
>[hidden email]
>http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>  
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

[ANN] Regex11 version 1.4.4

Steven Kelly
In reply to this post by Steven Kelly
Hi,

Since there were no dissenting opinions to the tidying up mentioned below,
I've published the results as 1.4.4. This includes Joachim's
#contains->#anySatisfy: refactoring - thanks!

One minor improvement request for the great work by Michel Bany in adding
numbered repetitions: the repetition currently doesn't handle subexpressions
in the expected way, e.g. to match the three RGB hex pairs in #ff00ff:
#([[:xdigit:]]{2}){3}
Other libraries interpret that as having three subexpressions.

Share and enjoy,
Steve

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Steven Kelly
> Sent: Friday, March 14, 2014 11:55 PM
> To: Niall Ross
> Cc: [hidden email]
> Subject: Re: [vwnc] [ANN] Regex11 version 1.4
>
> Dear Niall (or really jkott, who is presumably a Cincom colleague?)
>
> I hadn't noticed 1.4.3 before. Thanks for the addition. It looks a
> little
> unfinished to be considered the current trunk head: the version comment
> says
> just:
> 69706: "[SiouX] - Make WelcomeResponder friendly to non-html content"
> and the code changes look a little ad hoc. Maybe they make more sense
> in the
> context of a wider project, presumably SiouX, rather than being obvious
> extensions that fit in with Regex11 and extend it for all its users.
>
> Does RxMatcher need to implement asRegex and asRegexIgnoringCase? For
> the
> latter in particular it seems surprising that it just returns self,
> rather
> than making case be ignored. This breaks the idempotency I'd have
> expected,
> in that the following give different results:
>
> 'foo' asRegex asRegexIgnoringCase
> 'foo' asRegexIgnoringCase asRegex
>
> The use of \0, \1 etc. in the replacement string doesn't seem to match
> Ruby's
> documentation, in that it allows numbers past \9. I think the limit to
> \9 was
> probably a conscious decision in Ruby, to prevent ambiguity between
> '\10'
> meaning "first match plus a zero" versus "tenth match".
> http://stackoverflow.com/questions/1400937/more-than-9-backreferences-
> in-gsub
> As the last answer there shows, some languages allow just \0 to \9, a
> few
> also \10 to \99. The latter seem to have things like named or numbered
> groups, which can be used where necessary to avoid ambiguity; we don't
> have
> those (yet).
>
> Maybe these could be cleaned up in a 1.4.4? The replace methods could
> also do
> with a little code review, e.g.
> block numArgs = 1
> ifTrue: [block value: match]
> ifFalse: [block value: match value: matcher]].
> could be simply:
> block cull: match cull: matcher.
> which also copes with a block without any arguments (a rare but
> possible
> case, e.g. [readStream next]).
>
> Since I'm a little unsure of the context, I haven't simply published a
> clean-up of this, but I attach my efforts for your review. I think it's
> better that we don't have keyword arguments called 'string' that can
> also be
> blocks, so I separated out the string-to-block conversion. It would
> also be
> good to add a test and documentation (both on the class side of
> RxParser).
> And feel free to ANSIfy!
>
> All the best,
> Steve
>
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On
> > Behalf Of Niall Ross
> > Sent: Friday, March 14, 2014 6:21 PM
> > To: [hidden email]
> > Cc: [hidden email]
> > Subject: Re: [vwnc] [ANN] Regex11 version 1.4
> >
> > Dear Joachim,
> >     the latest trunk (1.4.3) of this goodie is in the OR.  If you
> > publish a version with ANSI #anySatisfy: instead of #contains: (and
> any
> > other fixes you recommend), it could be reviewed for inclusion in/as
> a
> > future trunk.
> >
> >              Thanks
> >                 Niall Ross
> > _______________________________________________
> > vwnc mailing list
> > [hidden email]
> > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Regex11 version 1.4.4

Steven Kelly
I'd think #cull: would be a useful addition anywhere. I'd certainly rather
use it than #numArgs, which does seem to be part of Grease, but requires
rather repetitive code to cope with each
value:/value:value:/value:value:value: case separately. Pharo and GNU
Smalltalk have had cull: for some years, and adding it to others seems easy
and risk-free.

#cull: is already used in Regex11 1.4 - and in a way that seems to rely not
just on VW, but on a specific VW version.
RmCurrentMatchContext>>performHandler: is a copy of
GenericException>>performHandler: from VW 7.6-7.8.1.

Does that work outside VW? Even if it does, it would seem to be incorrect for
any VW version after 7.8.1.

Cheers,
Steve

[hidden email] wrote Wednesday, May 7, 2014 2:50 PM

> There is one little problem I see with the use of #cull: and
> #cull:cull:.
>
> They are not part of VA Smalltalk's base library, and even worse, are
> also not in Grease, but in a port of Announcements. The latter problem
> is not of concern to VW people, but the first one should: using cull:
> reduces the portability of code.
>
> Am 07.05.14 12:31, schrieb Steven Kelly:
> > Hi,
> >
> > Since there were no dissenting opinions to the tidying up mentioned
> below,
> > I've published the results as 1.4.4. This includes Joachim's
> > #contains->#anySatisfy: refactoring - thanks!
> >
> > One minor improvement request for the great work by Michel Bany in
> adding
> > numbered repetitions: the repetition currently doesn't handle
> subexpressions
> > in the expected way, e.g. to match the three RGB hex pairs in
> #ff00ff:
> > #([[:xdigit:]]{2}){3}
> > Other libraries interpret that as having three subexpressions.
> >
> > Share and enjoy,
> > Steve
> >
> >> -----Original Message-----
> >> From: [hidden email] [mailto:[hidden email]] On
> >> Behalf Of Steven Kelly
> >> Sent: Friday, March 14, 2014 11:55 PM
> >> To: Niall Ross
> >> Cc: [hidden email]
> >> Subject: Re: [vwnc] [ANN] Regex11 version 1.4
> >>
> >> Dear Niall (or really jkott, who is presumably a Cincom colleague?)
> >>
> >> I hadn't noticed 1.4.3 before. Thanks for the addition. It looks a
> >> little
> >> unfinished to be considered the current trunk head: the version
> comment
> >> says
> >> just:
> >> 69706: "[SiouX] - Make WelcomeResponder friendly to non-html
> content"
> >> and the code changes look a little ad hoc. Maybe they make more
> sense
> >> in the
> >> context of a wider project, presumably SiouX, rather than being
> obvious
> >> extensions that fit in with Regex11 and extend it for all its users.
> >>
> >> Does RxMatcher need to implement asRegex and asRegexIgnoringCase?
> For
> >> the
> >> latter in particular it seems surprising that it just returns self,
> >> rather
> >> than making case be ignored. This breaks the idempotency I'd have
> >> expected,
> >> in that the following give different results:
> >>
> >> 'foo' asRegex asRegexIgnoringCase
> >> 'foo' asRegexIgnoringCase asRegex
> >>
> >> The use of \0, \1 etc. in the replacement string doesn't seem to
> match
> >> Ruby's
> >> documentation, in that it allows numbers past \9. I think the limit
> to
> >> \9 was
> >> probably a conscious decision in Ruby, to prevent ambiguity between
> >> '\10'
> >> meaning "first match plus a zero" versus "tenth match".
> >> http://stackoverflow.com/questions/1400937/more-than-9-
> backreferences-
> >> in-gsub
> >> As the last answer there shows, some languages allow just \0 to \9,
> a
> >> few
> >> also \10 to \99. The latter seem to have things like named or
> numbered
> >> groups, which can be used where necessary to avoid ambiguity; we
> don't
> >> have
> >> those (yet).
> >>
> >> Maybe these could be cleaned up in a 1.4.4? The replace methods
> could
> >> also do
> >> with a little code review, e.g.
> >> block numArgs = 1
> >> ifTrue: [block value: match]
> >> ifFalse: [block value: match value: matcher]].
> >> could be simply:
> >> block cull: match cull: matcher.
> >> which also copes with a block without any arguments (a rare but
> >> possible
> >> case, e.g. [readStream next]).
> >>
> >> Since I'm a little unsure of the context, I haven't simply published
> a
> >> clean-up of this, but I attach my efforts for your review. I think
> it's
> >> better that we don't have keyword arguments called 'string' that can
> >> also be
> >> blocks, so I separated out the string-to-block conversion. It would
> >> also be
> >> good to add a test and documentation (both on the class side of
> >> RxParser).
> >> And feel free to ANSIfy!
> >>
> >> All the best,
> >> Steve
> >>
> >>
> >>> -----Original Message-----
> >>> From: [hidden email] [mailto:[hidden email]] On
> >>> Behalf Of Niall Ross
> >>> Sent: Friday, March 14, 2014 6:21 PM
> >>> To: [hidden email]
> >>> Cc: [hidden email]
> >>> Subject: Re: [vwnc] [ANN] Regex11 version 1.4
> >>>
> >>> Dear Joachim,
> >>>      the latest trunk (1.4.3) of this goodie is in the OR.  If you
> >>> publish a version with ANSI #anySatisfy: instead of #contains: (and
> >> any
> >>> other fixes you recommend), it could be reviewed for inclusion
> in/as
> >> a
> >>> future trunk.
> >>>
> >>>               Thanks
> >>>                  Niall Ross
> >>> _______________________________________________
> >>> vwnc mailing list
> >>> [hidden email]
> >>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
> > _______________________________________________
> > vwnc mailing list
> > [hidden email]
> > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
> >
>
>
> --
> -----------------------------------------------------------------------
> Objektfabrik Joachim Tuchel          mailto:[hidden email]
> Fliederweg 1                         http://www.objektfabrik.de
> D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
> Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Regex11 version 1.4

Steven Kelly
In reply to this post by jtuchel
[ANN] Regex11 version 1.4

Hi,

 

It looks like there's a problem with the explicitly numbered repetitions in Regex11 (1.4.6). The regex below takes a left-padded string and should extract a group to fit in 5 characters:

'     123' replaceRegex: '^ *(.{5}).*$' withString: '\1'

Unfortunately it only returns two characters, ' 1'

Other approaches work fine, e.g. dropping the last .*$ or matching the spaces individually:

^ ? ? ? ?(.{5}).*$

 

Just for clarity, I’m not asking for help with padding and truncating strings or using regexes, just reporting what seems to be a bug in numbered repetitions. The problem is the same with the shortcut method above and the lower-level #matches + #subexpression:.

All the best,

Steve

 
"Bany, Michel" [hidden email] schrieb:

All,
I have just published  Regex11 version 1.4 the Cincom Public Store Repository.
Compared with previous version (1.3.4) it has the following new features.

VERSION 1.4 (April 2013)
1. Support for explicitely numbered repetitions, with 39 tests added
2. Tests can be fired from the Launcher tools menu
3. All tests passed
4. Updated Launcher menu items to enable logging during tests
5. Enhanced the test tools to collect and re-run test failures
6. Testing mechanics enhanced to support repeating capturing groups

The documentation contains the following new fragment

Repetitions can also be represented explicitely using numbers
- Exactly three occurences: {3}
- Two to five occurences: {2,5}
- Three or more occurences: {3,}
- Zero, one or two occurences: {,2}

        'abbbc' matchesRegex: 'ab{3}c'          -- true
        'abc' matchesRegex: 'ab{2,5}c'          -- false: need at least two b
        'abbbbbbc' matchesRegex: 'ab{2,5}c'     -- false: may not have more than five b
        'abbbc' matchesRegex: 'ab{2,5}c'                -- true
        'abbbbbbc' matchesRegex: 'ab{3,}c'      -- true
        'ac' matchesRegex: 'ab{,2}c'            -- true

Feedback is welcome. Depending on the feedback, Cincom may include this new version on the release media.

Enjoy,
Michel.

__________________________________________
Michel Bany
Cincom Systems S.A.
Cours des Bastions 3 bis
1205 Genève

Switzerland
Tel.    +41 (0) 223 105 879
Skype   +33 (0) 970 444 870
Mobile  +33 (0) 608 933 306

Skype   michel.bany
http://www.cincom.com/smalltalk
[hidden email]




All, 
I have just published  Regex11 version 1.4 the Cincom Public Store Repository <http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Public+Store+Repository> .
Compared with previous version (1.3.4) it has the following new features.
 
 VERSION 1.4 (April 2013)
 1. Support for explicitely numbered repetitions, with 39 tests added
 2. Tests can be fired from the Launcher tools menu
 3. All tests passed
 4. Updated Launcher menu items to enable logging during tests
 5. Enhanced the test tools to collect and re-run test failures
 6. Testing mechanics enhanced to support repeating capturing groups
 
The documentation contains the following new fragment
 
 Repetitions can also be represented explicitely using numbers
 - Exactly three occurences: {3}
 - Two to five occurences: {2,5}
 - Three or more occurences: {3,}
 - Zero, one or two occurences: {,2}
 
        'abbbc' matchesRegex: 'ab{3}c'         -- true
        'abc' matchesRegex: 'ab{2,5}c'         -- false: need at least two b
        'abbbbbbc' matchesRegex: 'ab{2,5}c'   -- false: may not have more than five b
        'abbbc' matchesRegex: 'ab{2,5}c'              -- true
        'abbbbbbc' matchesRegex: 'ab{3,}c'    -- true
        'ac' matchesRegex: 'ab{,2}c'          -- true
 
Feedback is welcome. Depending on the feedback, Cincom may include this new version on the release media.
 
Enjoy,
Michel.
 
__________________________________________
Michel Bany
Cincom Systems S.A.
Cours des Bastions 3 bis
1205 Genève
Switzerland
Tel.    +41 (0) 223 105 879
Skype   +33 (0) 970 444 870
Mobile  +33 (0) 608 933 306
Skype   michel.bany
http://www.cincom.com/smalltalk
[hidden email]
 
 
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
 

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc