http://qs321.pair.com?node_id=171830


in reply to Apocalypse 5 and regexes

What are some of your reactions to the change?

It's time to get rid of traditional regexes, as they are too limiting. Change is needed, and I think Larry Wall did a very good job with this redesign. When I first read the recent Apocalypse, I hated the <s and >s, because it was too html-like. When reading more, it becomes clear that it doable.

<before:> and <after:> puzzle me. I had a feeling they had to be the other way around, but even though this is just a change of perspective, that is even worse. Somehow I never had this problem with the punctuation-laden (?=) and (?<=).

The colon overloading I do not like. Colon will already be very important in Perl 6 as the abverbial colon and probably some other meanings, but in regexes it is used for too many things. :, ::, ::: and :::: should be words, in my opinion. I dislike m/:i foo/. It's confusing, and dictating m:i/foo/ would be better imho. Especially m:w/foo/ and m/:w foo/ being inequal is weird.

Being able to capture into variables simplifies a lot. I like that feature, and will probably use it quite a lot. You say you're concerned about speed, but my guess is that it will be faster than a loop, because more can be handled in the core. Perl 6 itself is expected to be faster than 5 too, so I don't think speed will be a problem.

Best thing is the introduction of closures and boolean expression assertions. Currently, they are available, but the feature is experimental, confusing and inconsistent.

I like the new regexes.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.