part of why regexes feel like dark magic to a lot of people is that they look like symbol vomit. you could probably make them a lot more usable if you made them more verbose... somehow made it easier to insert nonsignificant whitespace and comments...
ooh, maybe you could package it in a nifty little functional programming style syntax and extend its functionality a little bit...
wait, i just invented parser combinators again
@00dani python has an excellent parser combinator library
rust has a few but i haven't tried them yet
@typhlosion real tho ? Please
@hy lots of languages have parser combinator libraries, if that's what you mean! haskell's parsec is arguably the most famous
@typhlosion that's why people tend to get parts like 0x\d+ into a HEX_NUM variable and then concatenate a bunch of them to form the final regex
@typhlosion I really feel like parser expression grammars should be taught as part of like, 101 level programming, just because like... They make input parsing so much easier than manually reading in numbers of characters and such
@typhlosion I've been thinking for a while that I just usually want an AST and constructors for regular expressions, rather than the string syntax. then you never have to escape anything and, more importantly, you can safely compose language fragments constructed in different parts of your program.
of course the downside is frequently that expressions can be quite a bit more verbose, but that's kinda what we wanted too...
I've used and written some libraries like that. my favorite for several reasons is https://sebfisch.github.io/haskell-regexp/ but I think it doesn't compile with current GHC. I wrote a proof of concept of a similar thing in Rust (https://github.com/jameysharp/weighted-regexp-rs) though it has plenty of sharp corners and I was also using it to explore parsing techniques for non-regular languages.
@typhlosion specifically you invented perl
@Xarph no, perl's regexes are no more readable than any other regexes
@typhlosion parser combinators but you can use them in mainstream programming languages