3 ms·
looks very interesting - coming from the perl (ie the original PCRE) it’s rather a pity that this is focused on the JVM since Java is not the most regex friendl
by librasteve 2y ago
looks very interesting - coming from the perl (ie the original PCRE) it’s rather a pity that this is focused on the JVM since Java is not the most regex friendly authoring environment (sorry I do not know if other JVM denizens like Kotlin / Clojure have more natural regex syntax)
Larry Walls version 2 of PCRE is doing some interesting innovation which, while continuing the model of a character level syntax where punctuation <[.+*]> and so on are the “verbs” as the regex Sub-Language (one of the Slangs of raku), now provides deep support for unicode (eg. a digit test looks at the unicode properties, not just <[0..9]>), and can be gradually unpacked using <token> and <rule> methods all the way up to a full blown composable class based Grammar … so you can still write regex one-liners perl style but then evolve that to a small Grammar to reduce line noise and drive up code clarity
Are there any plans to provide your library on the MoarVM?
- hyperpape 2y agoAuthor here. I don't know much about the MoarVM, so no plans. I have very idly thought about being able to output native code for use in other systems, but realistically, I have enough other ideas to keep my nights and weekends busy for a long time.
- CoastalCoder 2y ago> the Slangs of raku Sounds like the name of some race in a sci-fi story :)
- MrBuddyCasino 2y agoKotlin isn't too bad, you can avoid double-quoting and use .toRegex() on strings: val regex = """([\w\s]+) is (\d+) years old""".toRegex()