3 ms·
You might want to add Wolfram's Language String Patterns[1]. Perl 6 (which is now actually called Raku, for what it's worth) has BNF-style Grammars as a first
by Banana699 5y ago
You might want to add Wolfram's Language String Patterns[1].
Perl 6 (which is now actually called Raku, for what it's worth) has BNF-style Grammars as a first class citizen of the language (a virtually unheard of thing AFAIK), and programmers are encouraged to use it for complex parsing tasks instead of regex. I don't know whether that falls under "alternative syntax for regex", they are very closely related to regexes and actually much more powerful and readable, including regexes as a subset. But adding them might drag you into adding every Context Free\Parsing Expression Grammar tool out there, things like Bison and YACC and Antlr.
The language SNOBOL[2][3][4] is one of the earliest languages with text matching and processing as a first class citizen (in fact, the only citizen). Being designed (1962) before the first software implementation of regular expressions* (1968), the pattern language it uses is not based on regular expression, and in some cases actually exceeds it (e.g. matching balanced parenthesis, which mathmatical regex can't do, but some variants of practical regexes can with special non-regular constructs).
This thread[5] in Retrocomputing stack exchange discusses what is the earliest language with string pattern matching capabilities, and finds hidden gems in the process.
[1] https://reference.wolfram.com/language/guide/StringPatterns.html https://reference.wolfram.com/language/guide/StringPatterns....
[2] https://en.wikipedia.org/wiki/SNOBOL https://en.wikipedia.org/wiki/SNOBOL
[3] https://dl.acm.org/doi/10.1145/800025.1198417 https://dl.acm.org/doi/10.1145/800025.1198417
[4] https://www.snobol4.org/ https://www.snobol4.org/
[5] https://retrocomputing.stackexchange.com/questions/658/what-was-the-first-language-with-regexes https://retrocomputing.stackexchange.com/questions/658/what-...
* : As opposed to the mathematical definition of regular expression, which dates back to 1956 and perhaps even before.
- chubot 5y agoThanks for the links, I added Wolfram. I think SNOBOL might count, but it's a bit different in that I think it's a "dead" language now? e.g. it doesn't appear to have a user base or implementations. But feel free to add it or anything else if there are good links. There's definitely a fuzzy line between things like LPeg or Rosie and YACC/ANTLR ... it's less about the power of the language and what kind of tasks people use it for, I suppose. If it's "scripting friendly".