I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
I don't hate the idea of these, but I do find them awkward.
When I read anythingBut(' ') I wonder, does it mean [^ ] or [^ ]+ or [^ ]*? How do I tell it that I mean any whitespace, like \s instead of a space? How is it clear that maybe(' ') and maybe(' ') are different1 and mean spaces and tabs respectively?
Back references? Discarded groups? All that shenanigans? I think I'd spend longer looking up how to do something with this sort of wrapper than I would just using regex in the first place. You can split regex over lines and add comments for them, so there shouldn't be any ambiguity. You can test them just like you test anything else.
To me, verbal expressions seem like a cut-down wrapper rather than an abstraction, and I'm not sure how they would help in anything but the simplest cases.
Pretend there's a tab in that, I can't put one in markdown :) ↩
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't hate the idea of these, but I do find them awkward.
When I read
anythingBut(' ')
I wonder, does it mean[^ ]
or[^ ]+
or[^ ]*
? How do I tell it that I mean any whitespace, like\s
instead of a space? How is it clear thatmaybe(' ')
andmaybe(' ')
are different1 and mean spaces and tabs respectively?Back references? Discarded groups? All that shenanigans? I think I'd spend longer looking up how to do something with this sort of wrapper than I would just using regex in the first place. You can split regex over lines and add comments for them, so there shouldn't be any ambiguity. You can test them just like you test anything else.
To me, verbal expressions seem like a cut-down wrapper rather than an abstraction, and I'm not sure how they would help in anything but the simplest cases.
Pretend there's a tab in that, I can't put one in markdown :) ↩