Skip to content

Commit

Permalink
chore: add note about JDK and bytecode compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tony19 committed Jan 21, 2024
1 parent a46f1bc commit 9552147
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
named-regexp [![GitHub release](https://img.shields.io/github/release/tony19/named-regexp.svg?maxAge=2592000)](https://github.com/tony19/named-regexp/releases/) [![Build](https://github.com/tony19/named-regexp/actions/workflows/ci.yml/badge.svg)](https://github.com/tony19/named-regexp/actions/workflows/ci.yml)
---

This lightweight library adds support for [named capture groups](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#groupname) in Java 5/6 (and on Android).

This is a fork of the [named-regexp](http://code.google.com/p/named-regexp) project from Google Code (currently inactive).

This library backports [named capture groups](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#groupname) from Java 7 to Java 5/6.

Usage
-----
You can use the same constructs for named capture groups from Java 7 (i.e., `(?<name>patt)`, etc.), as in the following example:
You can use the same constructs for named capture groups from Java 7
(i.e., `(?<name>patt)`, etc.), as in the following example:

```java
import com.google.code.regexp.Pattern;
Expand Down Expand Up @@ -54,6 +52,10 @@ $ cd named-regexp
$ mvn package
```

To create Java 5/6 compatible bytecode, use JDK 11 or older to build this library.
The build automatically targets Java 8 (the minimum supported version) if using a
newer JDK to build.

Release
-------

Expand All @@ -65,7 +67,8 @@ $ ./release.sh

*Releases are deployed to https://repo1.maven.org/maven2/com/github/tony19/named-regexp/*

To release a `SNAPSHOT` (i.e., the version in `pom.xml` ends with `-SNAPSHOT`), run the following command:
To release a `SNAPSHOT` (i.e., the version in `pom.xml` ends with `-SNAPSHOT`),
run the following command:

```bash
$ mvn clean deploy
Expand Down

0 comments on commit 9552147

Please sign in to comment.