Hi all,
as you may have noticed, I have proposed some new features for Regex-Core in recent past, and I found a lot of fun in working with this clean architecture for which I still see a lot of potential for expansion (for example, I'm currently having basic support for Unicode matches in my pipeline, this is currently blocked by this thread. For the future, I also would like to consider named groups & depending features). But before I will invest unnecessary time into the Regex-Core package, I have one question:
Recently I stumbled upon VB-Regex, which looks very similar to Regex-Core. Has this been a predecessor of Regex-Core, is it a successor or are they two independent forks? I could not find any information about this topic on the web. Is my assumption correct that Regex-Core is the regex "state of the art" within Squeak?
Best, Christoph
Carpe Squeak!
|
Hi Christoph,
On Sun, 29 Mar 2020, Thiede, Christoph wrote: > > Hi all, > > > as you may have noticed, I have proposed some new features for Regex-Core in recent past, and I found a lot of fun in working with this clean architecture for which I still see a lot of potential for expansion (for example, I'm currently having basic support for Unicode matches in my pipeline, this is currently > blocked by this thread. For the future, I also would like to consider named groups & depending features). But before I will invest unnecessary time into the Regex-Core package, I have one question: > > > Recently I stumbled upon VB-Regex, which looks very similar to Regex-Core. Has this been a predecessor of Regex-Core, is it a successor or are they two independent forks? I could not find any information about this topic on the web. Yes, Regex-Core is a descendant of VB-Regex. > > Is my assumption correct that Regex-Core is the regex "state of the art" within Squeak? Yes. Levente > > > Best, > > Christoph > > > |
In reply to this post by Christoph Thiede
You posted an #asRegex example in talking to Eliot about inlining recently. I’ve printed it out and plan to play with it next week.
If you have any more thoughts or examples using the VB-Regex package, I hope you’ll post some here. I’m very interested in this stuff. Chris
|
Hi Regex friend :-)
I assume you are referring to Regex-Core (thanks for the clarification, Levente!).
Yes, regexes are indeed very nerdy fun, though I recommend to use them rarely in production stuff, they just don't provide a really good readability. I don't know how experienced you are with regex in general, but I can recommend you regex101.com if you did not know it yet. I'm not sure what you are looking for in detail, but if you're interested in further examples, here are a few ones:
http://forum.world.st/The-Inbox-Tests-ct-429-mcz-td5113665.html#:~:text=allRangesOfRegexMatches (see #testUndefinedVariable and #testUnusedVariable).
In Regex-Core-ct.55 f., I extended the implementation of lookaround expressions in Smalltalk. (This is a small piece of art:
'(?<=(?<!n''t\s+)l[o]ve\s+)\w+' asRegex matchesIn: 'I love Squeak. I don''t love C++. I love Smalltalk.'.
:-))
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Chris Cunnington <[hidden email]>
Gesendet: Sonntag, 29. März 2020 18:08:44 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Question about VB-Regex You posted an #asRegex example in talking to Eliot about inlining recently. I’ve printed it out and plan to play with it next week.
If you have any more thoughts or examples using the VB-Regex package, I hope you’ll post some here. I’m very interested in this stuff.
Chris
Carpe Squeak!
|
Thank you for these resources. They look great. I’ve printed out your example and it’s now sitting beside the first printout in chapter seven of my volume of the 2nd edition of O’Reilly’s “sed & awk”, which I’ll return to reading this week. My Regex fu is weak, but it’ll improve. I aim to import a huge load of strings into a Squeak image in future to experiment with creating graphs with them. It’s nothing to talk about yet. Part of this process with sed & awk is circling around things slowly to fill some holes in my compsci knowledge. Thank you for your help.
Chris The Stranglers - Golden Brown https://www.youtube.com/watch?v=AtTsky80XmQ
|
In reply to this post by Christoph Thiede
I know it’s a little old-fashioned to recommend a book, but you might learn a thing or two about regexes from Mastering Regular Expressions by Friedl. It’s an OReilly book. Mine’s copyright 2002, second edition, about 430 pages deep. Still on my reference shelf after 20 years.
/————————————————————/ For encrypted mail use [hidden email] Get a free account at ProtonMail.com Web: https://objectnets.net and https://objectnets.org https://datascilv.com https://datascilv.org On Mar 29, 2020, at 11:42, Thiede, Christoph <[hidden email]> wrote:
|
That’s an excellent suggestion. I forgot about that book. I had it over ten years (and several moves) ago. Thinking about it now, I seem to recall that Friedl was not just an expert, but quite conscientious about making the topic accessible. Thank you for the reminder. (And I also prefer books because I like to highlight things.)
Chris
|
Well, I know that learning is a very subjective topic, but personally, I was very happy with learning all the regex stuff I needed by trial, error, and StackOverflow ;-) I'm wondering how you can actually fill a book about this topic? Is that book about the actual implementation of a regex machine?
Take a cheat sheet like this (https://www.rexegg.com/regex-quickstart.html, it's just *any* cheat sheet) and you know 95 % of the syntax. Best,
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Chris Cunnington <[hidden email]>
Gesendet: Montag, 30. März 2020 17:10:09 An: John Pfersich; The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Question about VB-Regex That’s an excellent suggestion. I forgot about that book. I had it over ten years (and several moves) ago. Thinking about it now, I seem to recall that Friedl was not just an expert, but quite conscientious about making the topic accessible. Thank you
for the reminder. (And I also prefer books because I like to highlight things.)
Chris
Carpe Squeak!
|
Am Mo., 30. März 2020 um 19:23 Uhr schrieb Thiede, Christoph
<[hidden email]>: > > I'm wondering how you can actually fill a book about this topic? Is that book about the actual implementation of a regex machine? I wondered the same thing, so I googled this morning. You can look up the table of contents online. One chapter indeed is about how to implement regex machines (different approaches). But it is also about using regular expressions in different programming languages, optimization etc. |
Free forum by Nabble | Edit this page |