Library / SDK
VerbalExpressions/JavaVerbalExpressions avatar
VerbalExpressions/JavaVerbalExpressions

JavaVerbalExpressions: a fluent regex builder whose newest release is 1.8 from March 2021

Java regular expressions made easy.

2,618 stars241 forksJavaMIT

At a glance

What is it?
VerbalExpressions/JavaVerbalExpressions builds regular expressions through a chainable builder with test, testExact and capture support, published to Maven Central under the group id ru.lanwen.verbalregex. Commits continue, releases have not since 2021.
Who is it for?
This library earns a place in a codebase that builds a handful of patterns and cannot afford to read its own regex source, because test, testExact and explicit capture groups remove the usual sources of silent mistakes. What you accept by adopting it is a dependency whose published artifact is five years behind its commit history, which means fixes on the master branch are not available to a Maven consumer and a bug you find will not be fixed for you through an upgrade.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 45 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • VerbalExpressions/JavaVerbalExpressions2,618 ★ · +0
Star history
Repository2026-10-042026-11-15
VerbalExpressions/JavaVerbalExpressions2.6k2.6k

0 Stars in the last 42 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The Maven coordinates do not match the project name

The dependency block names a group id that belongs to neither the repository nor its organisation:

xml
<dependency>
  <groupId>ru.lanwen.verbalregex</groupId>
  <artifactId>java-verbal-expressions</artifactId>
  <version>1.8</version>
</dependency>

The repository is JavaVerbalExpressions under the VerbalExpressions organisation, and the build badge points at the same ru.lanwen.verbalregex path on Maven Central, so the published coordinates and the published location agree with each other and disagree with the project's name. That inconsistency is permanent in practice, because renaming a group id is a different artifact and every existing pom that names the old one would break. The documented version is 1.8, which matches the newest release, so the instructions do at least describe what is actually on Maven Central rather than an aspirational version. A reader copying this block gets the published artifact, which is the only thing that matters, at the cost of a group id that reveals nothing about the project behind it.

The newest release is 1.8 from March 2021

Three releases are listed: 1.6 in October 2018, 1.7 in August 2019, and 1.8 in March 2021. The last commit to the repository is dated 2026-09-01, so the gap between the newest tag and the newest work is more than five years. That gap is the single most important fact about depending on this library. A Maven consumer resolves 1.8 and stops there, no matter how many commits sit on the master branch, and a fix that landed last month is invisible until someone cuts a release. The two newest release names are bare version numbers with no message, while the middle one carries a note, which suggests release notes were never part of the habit here. Nothing on the page says the project is finished or abandoned, and the commit date says work is still happening. Both things are true at once, and a team choosing a dependency has to plan for the tag, not the branch.

The snapshot instructions stop before the version string

Snapshot builds get two sentences and one block. The sentences say a snapshot dependency can be used by adding something to the pom, and the block that follows contains only a repositories section pointing at the Sonatype OSSRH snapshots endpoint:

xml
<repositories>
  <repository>
    <id>ossrh</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  </repository>
</repositories>

No dependency block accompanies it, and no version string ending in a snapshot suffix is shown, so the reader is told where snapshots live but not what to write in the version field. Given that the released artifact stops at 1.8, this is the only documented route to anything newer than 2021, which makes the omission consequential rather than cosmetic: the path to current code is the path with a hole in it. It also leaves the stability question open, since snapshot artifacts change under a fixed version string by design, so a build that resolves from that repository is not reproducible without pinning a timestamped build.

test and testExact disagree about the same string

The library's simplest demonstration is also its most useful warning. A pattern built from start of line, then abc, or def, and end of line is run against the string defzzz: test returns true, testExact returns false, and getText returns def. So one method asks whether the pattern appears anywhere in the input, and the other asks whether the input is entirely the pattern, which is the pair most likely to be confused in validation code. The generated pattern shows what the builder emits, and the wrapping is uniform: every literal goes inside its own non-capturing group, optional pieces become a question mark on that group, anythingBut becomes a negated character class, and the anchors are added by the two anchor methods. The escaping is the builder's own rather than yours, so a pattern you can read in the source is not the pattern that runs, and toString is the only way to see it.

Captures are explicit, and getText returns the capture

Because every literal is wrapped in a non-capturing group, only the capture methods produce a real capturing group, and only those groups are numbered. A pattern that finds a, then opens a capture, finds b, matches anything, closes the capture, then matches cd, returns abcd from getText with one argument and b from getText with the capture index. That first result is the one to read twice: for a pattern with a capture, the single argument form hands back the captured portion rather than the whole match, which is not what the method name suggests. The builder is also reusable. A fragment of digits, one or more, closed and followed by a tab can be built once and inserted twice into a larger pattern, and a builder can be cloned before further calls, so a shared fragment does not have to be rebuilt by hand at each use site.

Nine ports, and one of them sits outside the project

The page collects the other implementations of the same idea: JavaScript, PHP, Python, C#, Objective-C, Ruby, Groovy, Haskell and C++, with an ellipsis and an attribution for the rest. Two entries are shaped differently from the others. The Ruby port points at a personal repository rather than at a project namespace, so its maintenance depends on one person outside the organisation that hosts the other eight. The C++ entry points at the organisation itself with no repository named, so the link does not tell you which project to look at. Beyond the links, nothing here records which ports are on which version, so the usual question when adopting one, whether the Java behaviour matches the Python or the JavaScript behaviour you already rely on, has no answer on the page. The list is a signpost, not a compatibility matrix, and each port has to be evaluated on its own.

Travis runs the release path, documented by a tutorial

The tree carries a Maven pom, an OSGi bundle descriptor beside it, and Travis configuration in two forms, a travis file at the root and a travis directory. A coverage badge points at Coveralls, and the last section of the page says the project is released with Travis and links to a tutorial on another site for uploading snapshots and releases to Maven Central. So the path from a commit to an artifact on Maven Central is described by someone else's blog post rather than by anything in the repository, and no file here states which account publishes, which profile signs, or what a release requires. That is a real cost when a release has to happen again: the person doing it is reconstructing a procedure from a third party article. The Maven Central badge is likewise served by a third party endpoint rather than by the project's own metadata, another small dependency on outside infrastructure for something that should be local.

Editorial conclusion

This library earns a place in a codebase that builds a handful of patterns and cannot afford to read its own regex source, because test, testExact and explicit capture groups remove the usual sources of silent mistakes. What you accept by adopting it is a dependency whose published artifact is five years behind its commit history, which means fixes on the master branch are not available to a Maven consumer and a bug you find will not be fixed for you through an upgrade. Two things to check first: pin the version you tested against, since 1.8 is what the documentation shows and nothing newer is published, and read the generated pattern once with toString before trusting it in production, because the escaping the builder applies is not the escaping you would have written. For anything beyond pattern matching, keep a plain Java regex where a reader can audit it.

Frequently asked questions

What are the Maven coordinates for JavaVerbalExpressions?

The group id is ru.lanwen.verbalregex, the artifact id is java-verbal-expressions, and the documented version is 1.8, which matches the newest release published to Maven Central.

What is the difference between test and testExact?

test reports whether part of the string matches, while testExact requires the entire string to match. In the documentation's example, a pattern of abc or def returns true for the string defzzz under test and false under testExact.

How do I get capture groups out of a JavaVerbalExpressions pattern?

Open a capture with capt() and close it with endCapture(), then pass the string and the capture index to getText, or the string alone to get the captured portion. Index 1 returned b in the example given.

How do I use a snapshot build of JavaVerbalExpressions?

The documentation shows a repositories block pointing at the Sonatype OSSRH snapshots endpoint, but it does not show a dependency block or a snapshot version string to go with it.

Which languages have VerbalExpressions ports?

The page lists JavaScript, PHP, Python, C#, Objective-C, Ruby, Groovy, Haskell and C++. The Ruby entry points at a repository outside the project organisation, and no version parity between ports is recorded.

How is JavaVerbalExpressions built and released?

The tree carries pom.xml for the Maven build, bnd.bnd for OSGi metadata, and Travis configuration in a .travis.yml file and a .travis directory, while the release procedure itself is described by an external tutorial rather than in the repository.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. VerbalExpressions/JavaVerbalExpressions on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/verbalexpressions-javaverbalexpressions.svg)](https://hysenlabs.com/projects/verbalexpressions-javaverbalexpressions)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/verbalexpressions-javaverbalexpressions.svg)](https://hysenlabs.com/projects/verbalexpressions-javaverbalexpressions)

Was this useful?