Epitaph

Named presets for Java regular expressions

A Java wrapper over java.util.regex whose builder takes either a raw pattern or one of 34 named presets, then answers find, matches and group against an input.

ArchivedPersonalOpen source

Record

Kind
Package
Role
Author
Started
November 2020
Ended
January 2021
Licence
Apache-2.0

Technology1

Evidence11 sources

The GitHub repository is archivedrepogithub.com The LICENSE file is the unmodified text of the Apache License 2.0licencegithub.com The repository describes its purpose as taking "an obscure and non-intuitive regular expression" and making it reusable, providing "presets for such frequent but unremembered spell-like regular expressions"repogithub.com Epitaph.builder takes either a preset or a pattern string plus the input to match, and build compiles them into a java.util.regex.Matcher; find, lookingAt, matches, group, replaceFirst and replaceAll are the six methods that delegate to itsourcegithub.com The presets are RegexPattern, an enum of 34 constants that pairs a code with the pattern string — EMAIL_ADDRESS, DOMAIN_NAME, WEB_URL, USER_ID, PASSWORD, three date formats, IP_ADDRESS with and without a port, four file-name patterns, the Japanese fixed-line, mobile and post-code formats, and kanji, hiragana and katakanasourcegithub.com The flags are RegexOption, an enum of the nine java.util.regex.Pattern constants from UNIX_LINES to UNICODE_CHARACTER_CLASS, passed to the builder as an EnumSet and combined before the pattern is compiledsourcegithub.com Both enums implement BiCatalog from Catalog API, which is what gives each constant its code and its second value — the pattern string for one, the Pattern flag for the othersourcegithub.com A builder missing its pattern or its input fails at build with an IllegalStateException, raised through Precondition Validator's Preconditions.requireNonNull rather than by a hand-written checksourcegithub.com build.gradle sets the group org.thinkit.common.regex, declares precondition-validator v1.1.0 and catalog-api v1.0.2 among its implementation dependencies, and publishes to GitHub Packages rather than to a public repositorysourcegithub.com One release was published, v1.0.1 on 15 December 2020repogithub.com The README heads the project Fluent Regex rather than Epitaph, states the copyright as Kato Shinya, 2020, and directs the reader to contact the author for a token to download the packagedocsgithub.com

Links2

Relations3 edges

Catalog APIDepends onCommon lookup behaviour for Java enums Precondition ValidatorDepends onJava argument checks that throw EnvaliUsed byAnnotation-driven entity validation for Java