Do you genuinely, truly believe that "4 digits then "-" then 2 digits then "-" then 2 digits" is more readable than "\d{4}-\d{2}-\d{2}"? Do you think your walls of text won't make everyone's eyes glaze over a few lines in? More importantly, do you believe it's more writable? A lot of regex operations are ad-hoc, and being able to type them out quickly and look at them in a small text field at a glance is very important. And as far as coding is concerned, well, your thing is useless outside of the JS ecosystem, is it not?
Dead? Replaced?... Your toy is cute, but it's more suited as a regex generator, or perhaps parser/"explainer" (but we already have several well-known projects there) than a standalone tool.
The effort here is laudable, and this is cool! But your real competition isn't regexes, but parser combinator libraries. For cases where readability and matching matter, parser combinators are the go to. It's a bit difficult to see how this improves on that front.
The preferred style here for the titles is more dry, something like "Matchlang: A pattern matching language that replaces regular expressions. Full parse trees, no ReDoS" or a shorter version like "Matchlang: A replacement for regular expressions. Full parse trees, no ReDoS".
If you write in the title "Regex is dead" people will get skeptical and ask for proofs.
andOlga|3 days ago
Dead? Replaced?... Your toy is cute, but it's more suited as a regex generator, or perhaps parser/"explainer" (but we already have several well-known projects there) than a standalone tool.
AkshatM|3 days ago
hollowsolve|3 days ago
Instead of this: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
You write this:
email: username then "@" then domain
username: one or more of (letter, digit, ".", "_", "-")
domain: one or more of (letter, digit, "-") then "." then between 2 and 6 letters
Match features:
- WASM JIT + JS JIT: matches or beats native regex on most patterns
- Linear-time parsing, no backtracking, no ReDoS, ever
- Full parse trees with named extractions, not just match/no-match
- Zero dependencies, ~7KB, MIT licensed
- Composable grammars via modules
Website: https://matchlang.com
Performance: https://matchlang.com/docs/api/performance
GitHub: https://github.com/hollowsolve/Match
gus_massa|2 days ago
If you write in the title "Regex is dead" people will get skeptical and ask for proofs.
sgt|3 days ago
hollowsolve|3 days ago