Regular expression tools for Java developers.
RegexBuilder
is a class for building regular expressions in a more human-readable way using a fluent API. It offers a number of benefits over using raw regex syntax in strings:
- No knowledge of regular expression syntax is required: just use simple, intuitively-named classes and methods.
- Code is easier to read, understand and maintain.
- Code is safer and far less prone to regular expression syntax errors and programmer errors.
Here's an example:
Pattern regex = new RegexBuilder()
.text("Hello")
.whitespace(RegexQuantifier.oneOrMore())
.text("world!")
.buildRegex();
But that's just a taste of what RegexBuilder
does: for full API documentation, head over to the project wiki.
The logging API added in version 1.3 wasn't adding as much value as intended and incurred an additional maintenance overhead. It is removed in version 2.0.
RegexToolbox.Java is hosted on JitPack.
Replace x.y.z
with the latest version (shown in the JitPack badge at the top of this page).
repositories {
...
maven { url 'https://jitpack.io' }
}
implementation 'com.github.markwhitaker:RegexToolbox.Java:x.y.z'
MimeTypes.Java: MIME type constants for your Java projects