Even as a developer you may have to assemble a regular expression at runtime, at which point a library that can do it for you may be much more handy than having to assemble the string yourself.
And even if you know regex by heart - assembling it with function calls can still be better / safer just like you shouldn't insert SQL parameters by hand into your SQL query strings.
I can't learn them. I've tried for over 20 years and every time I use them the knowledge is deleted from my brain immediately. A library like this would be very helpful if it worked.
One problem is that I'm more likely to need regex almost anywhere but Java code.
At the bottom there's a list of other languages that support the same API
That does not work so well if you're working in a team. A fairly complex regular expression is always hard to read.
We see this as early as in code review and as late as when you find a production bug because expectations of the surrounding code have changed.
For those reasons, we usually break regexes into parts anyway, and name and comment the single parts. Using the library's example, we might have:
protocol = "^(?:http)(?:s)?"
protocol_separator = "(?:\:\/\/)"
url = "(?:www\.)?(?:[^\ ]*)$"
regex = protocol + protocol_separator + url
Which turns out to be in the direction of these Java Verbal Expressions. I find the Verbal Expressions idea really enlightening.I think there is value in both cases. I've seen many developers that have struggled with regex even with all those hundreds of tools to learn and to build/test regex. This could be useful to them to start with, and they can learn regex according to their time/needs. I see solutions like this as a choice, and the fact that people are using these shows that there is value in having that choice, even if is not obvious to us at first glance.
A normal regex with a comment above it explaining what it does (for complex cases) always worked well for me.