Comments (4)
Hmm. This library is a backport of named capture groups, which were introduced in Java 7. If you can target Java 8, why would you need to use this library? What am I missing?
If it really is needed, I suppose I could create a major release that renames namedGroups()
to namedGroupsList()
as an upgrade path.
from named-regexp.
I decided to address the problem anyway.
Fixed in #74, released in v1.0.0.
from named-regexp.
The namedGroups()
API was added to the JDK in JDK 20: https://bugs.openjdk.org/browse/JDK-8292872
The repro also required updating the source version to 1.8:
diff --git a/pom.xml b/pom.xml
index c88cba2..2f96e9d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,8 +60,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
- <maven.compiler.source>1.6</maven.compiler.source>
- <maven.compiler.target>1.6</maven.compiler.target>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
</properties>
<build>
from named-regexp.
Thanks, that is a good question! I noticed this because my employer builds third party dependencies from source, and I was testing with Java 21. We were using named-regexp as a dependency of https://github.com/contentful/contentful.java
Using java.util.regex
instead of the backport works for me, I also sent a PR to update contentful: contentful/contentful.java#297
from named-regexp.
Related Issues (14)
- Named group index is incorrect after parens in a character class HOT 2
- Named group index is incorrect after character class boundaries '[' and ']' in quote HOT 6
- com.google.code.regexp.Pattern class isn't Serializable (java.util.regex.Pattern is) HOT 5
- Exposing java.util.regex.Pattern.CASE_INSENSITIVE as Pattern.CASE_INSENSITIVE HOT 4
- Matcher#namedGroups() returns only first matching subsequence HOT 6
- Runs out of memory, when no group is present in the regex HOT 4
- Getting runtime crash in release build HOT 3
- Up to date release HOT 1
- OOME when group matches empty string HOT 1
- Escaped characters get "un-escaped" when using Matcher.appendReplacement HOT 4
- Infinite loop when using Matcher.namedGroups HOT 2
- Broken backward compatibility of `namedGroups()` method HOT 1
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from named-regexp.