Regular Expressions?

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Regular Expressions?

Postby Livardo » Fri Mar 14, 2008 8:58 am

Hi all,

How have people implemented Regular Expressions in VIsual Age?

I understand there's not an "official" parser available, but is there any free alternatives out there?

Could there be something in the Win32 APIs I could hook into? Please, save me from the Java guys making fun of me! :D

Thanks!

Jorge
Livardo
 
Posts: 27
Joined: Thu Nov 01, 2007 6:33 am

Re: Regular Expressions?

Postby Livardo » Fri Mar 14, 2008 12:31 pm

As a follow-up.. I found a "free" library based on the Perl Regex engine called "PCRE". Has anyone built a wrapper for it by any chance and wouldn't mind sharing the code?

Thanks.
Livardo
 
Posts: 27
Joined: Thu Nov 01, 2007 6:33 am

Re: Regular Expressions?

Postby daswartz » Fri Mar 14, 2008 5:11 pm

Livardo wrote:How have people implemented Regular Expressions in VIsual Age?I understand there's not an "official" parser available, but is there any free alternatives out there?


Not free, but... If David Pennington and Totally Objects are still active, they have a regexp parser for VAST for around $100 US for a site license. http://www.totallyobjects.com/rest.htm The things I have purchased from Totally Objects have always worked well.

Vassili Bykov ported his free regular expression parser to VAST way back in 1999. Right now, I can't find it on the web. I'm pretty sure it was on the old UIUC Smalltalk site, but that has been down for while. This is an example of useful goodies we need to get collected on a site. Preferably a site supported by Instantiations.

Doug Swartz
daswartz
 
Posts: 48
Joined: Sat Oct 21, 2006 8:12 am
Location: Omaha, USA

Re: Regular Expressions?

Postby Livardo » Mon Mar 17, 2008 9:14 am

daswartz wrote:Not free, but... If David Pennington and Totally Objects are still active, they have a regexp parser for VAST for around $100 US for a site license. http://www.totallyobjects.com/rest.htm The things I have purchased from Totally Objects have always worked well.

Vassili Bykov ported his free regular expression parser to VAST way back in 1999. Right now, I can't find it on the web. I'm pretty sure it was on the old UIUC Smalltalk site, but that has been down for while. This is an example of useful goodies we need to get collected on a site. Preferably a site supported by Instantiations.

Doug Swartz



I did find a reference to Vassili's code in the old newsgroup, alas, I couldn't actually find the code! I did find a Visual Works .st file in but that's it. The PCRE documentation is intimidating. I did hook into DLLs a long time ago but I'd rather not, if I don't have to!

Instantiations does have a Goodies section at the Smalltalk page, they just don't have the Regex parser there.

We may just go with the Totally Objects solution.
Livardo
 
Posts: 27
Joined: Thu Nov 01, 2007 6:33 am

Re: Regular Expressions?

Postby daswartz » Mon Mar 17, 2008 5:22 pm

Livardo wrote:How have people implemented Regular Expressions in VIsual Age?


One more note: If you don't really need regular expressions, but just need to do very simple string matching, you can use the String>>match: method. It does simple * (any multicharacter) and # (any single character) pattern matching. For instance:

'abc*d#f*46' match: 'abcbasd789faisjdhfaiud46'

returns true. Beware however, for some reason probably lost in the sands of time, match: is case insensitive. Thus,

'abc*d#f*46' match: 'aBCbasd789faisjdhFaiud46'

also returns true.

Doug Swartz
daswartz
 
Posts: 48
Joined: Sat Oct 21, 2006 8:12 am
Location: Omaha, USA

Re: Regular Expressions?

Postby Hans-Martin » Tue Mar 18, 2008 5:37 am

Livardo wrote:I did find a reference to Vassili's code in the old newsgroup, alas, I couldn't actually find the code! I did find a Visual Works .st file in but that's it.

We have been using Vassili's Regex for quite a long time. I would have attached it to this post, but the forum software sez "The extension dat is not allowed" and at the moment I don't have access to any server where I could place it easily.

Cheers,
Hans-Martin
Hans-Martin
 
Posts: 12
Joined: Tue Oct 17, 2006 3:44 am

Re: Regular Expressions?

Postby Livardo » Wed Mar 19, 2008 5:33 am

Hans-Martin wrote:We have been using Vassili's Regex for quite a long time. I would have attached it to this post, but the forum software sez "The extension dat is not allowed" and at the moment I don't have access to any server where I could place it easily.

Cheers,
Hans-Martin


I think we're gonna go with TORest, but would you be able to email me the .dat file to:

vancouver.smalltalker at gmail dot com?

I'd like to have a backup, just in case. Thanks!
Livardo
 
Posts: 27
Joined: Thu Nov 01, 2007 6:33 am

Re: Regular Expressions?

Postby jtuchel » Tue Mar 25, 2008 6:05 am

Would Instantiations be willing to host this goodie if Vassily agrees to have it hosted on the Instantiations site?
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: Regular Expressions?

Postby wembley » Tue Mar 25, 2008 9:44 am

Joachim -

I actually have regex11.dat with a date of Oct 4, 1999 that I assume I got from Vassili long ago. I don't know if it is the latest version (anyone out there have a newer version of VbRegex than 99/10/03 1.1?), but I do know that it has some compatibility issues with the latest VA Smalltalk release (mostly having to do with method additions I've done for Seaside support). The license included with the code does not indicate any restrictions on its use other than that the license and copyright remain with the code and any changes to the code are clearly identified as not being done by Vassili.

I would be willing to put this version (or a newer version if someone has it and can send it to me) up on our Goodies page with the caveats above regarding incompatibilities. If no one else does, I might even get around to fixing the incompatabilities some day :wink:
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: Regular Expressions?

Postby Hans-Martin » Sat Apr 05, 2008 2:34 am

That's the version I have as well, and it works without problems for us (but our usage is pretty limited, so there might be bugs upon which I did not stumble yet).
There are two method conflicts with VAST 7.5 (whileTrue and whileFalse), but since the definition of these methods is similar in the base image and in VBRegex, they don't represent a problem.

Cheers,
Hans-Martin
Hans-Martin
 
Posts: 12
Joined: Tue Oct 17, 2006 3:44 am

Re: Regular Expressions?

Postby koester » Wed Nov 12, 2008 1:28 am

Hello,

can someone send me the .dat file or tell me when this will be available on the goodies page?

Greetings,

Bernd Köster
koester
 
Posts: 1
Joined: Wed Nov 12, 2008 12:24 am

Re: Regular Expressions?

Postby bpieber » Tue Apr 14, 2009 5:55 am

Just for the records, I'd also be very interested in this. Could it be put on VAStGoodies.com?

Cheers,
Bernhard
bpieber
 
Posts: 27
Joined: Sat Nov 04, 2006 4:00 am

Re: Regular Expressions?

Postby jtuchel » Fri Jul 10, 2009 1:52 am

Hi there

any news on the VBRegex code from Vassily?

Kind regards

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: Regular Expressions?

Postby marten » Mon Jul 13, 2009 9:51 am

Livardo wrote:Hi all,

How have people implemented Regular Expressions in VIsual Age?

I understand there's not an "official" parser available, but is there any free alternatives out there?

Could there be something in the Win32 APIs I could hook into? Please, save me from the Java guys making fun of me! :D

Thanks!

Jorge


After reading Joachims posting yesterday I looked around and I've created a very small first binding to the Tre library available at http://www.laurikari.net/tre/index.html. The first work has three C api call bindings to do first work. Other calls may also be wrapped - but I have no actual need for this now. Fell free to extend the wrapper and upload a new version. You can download it from http://vastgoodies.com/maps/MSKTreBinding.

If you have the need to do a single match against a pattern (and not a repetetive match against the same pattern) you may execute code like:

Code: Select all
  ('locomotion' mskMatchPattern: 'l[a-z]*') == true
      
  ('mocomotion' mskMatchPattern: 'l[a-z]*') == false


Otherwise you may use the wrapper like
Code: Select all
  | anInstance rc  matches |
         
(anInstance := MSKTreInterface withPattern: 'l[a-z]*') notNil
  ifTrue:[            
    (anInstance matchesString: 'locomotion') ifFalse:[ self halt ].
    (anInstance matchesString: 'mocomotion') ifTrue:[ self halt ].            
  ].
  anInstance regFree.   


Marten
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Regular Expressions?

Postby jtuchel » Tue Sep 01, 2009 11:04 am

I just uploaded a port of VBRegex to VASTGoodies.com.
I am just starting to use it, so I cannot guarantuee it's 100% perfect, but at least the tests are all green and it seems to work for my first tries.

It is a port from Squeak, and I think it is the current version 1.1 as of October 1999. It's good enough for the Squeak and Pharo tribes, so I guess there is nothing more recent.

Have fun with it and let me know if there is something wrong with it (Not that I think I could do something about it, but it's always nice to get feedback ;-) ).

greetings from the ESUG in Brest

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Next

Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest