top | item 37041469

(no title)

cjm42 | 2 years ago

Let's face it, the Perl 5/PCRE regex syntax is atrocious. The only reason it exists is that (? was a syntax error in earlier regex syntaxes, so it could be redefined to mean anything.

Raku is an attempt to design a sane regular expression language from first principles, now that we know what we want them to be able to express. The alternative is being stuck with (?:this|(?>or that)) for the next 30 years.

discuss

order

pdntspa|2 years ago

Awful? It is inscrutable black magic and it is wonderful once you get it.

I haven't touched perl in years but I still find myself writing regex often!

Dylan16807|2 years ago

Yes, awful. It takes a crack in the wall and drives a bus through it, at a significant penalty to readability. The compatibility advantage doesn't matter when you're evaluating syntax in a vacuum.

masklinn|2 years ago

Also various langages allow formatting & commenting regexes and that’s quite useful. Named groups as well.

justinator|2 years ago

>Let's face it, the Perl 5/PCRE regex syntax is atrocious.

Agreed, but god-damn is it useful.

db48x|2 years ago

Raku’s new grammar syntax is much less awful and just as amazingly useful.