Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code
This branch is 55 commits behind tony19:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

README.md

named-regexp 0.2.3 Build Status

This lightweight library adds support for named capture groups in Java 5/6 (and on Android).

This is a fork of the named-regexp project from Google Code (currently inactive).

Usage

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

import com.google.code.regexp.Pattern;
import com.google.code.regexp.Matcher;

public class NamedRegexpTest {
    public static void main(String[] args) {
        // pattern contains capture group, named "foo"
        Matcher m = Pattern.compile("(?<foo>\\w+) world").matcher("hello world!");
        m.find();
        System.out.println(m.group("foo")); // prints "hello"
    }
}

See more examples

Download

Grab the latest release (named-regexp-0.2.3.jar) and include it in your classpath...

OR Maven users can simply add this dependency:

<dependency>
  <groupId>com.github.tony19</groupId>
  <artifactId>named-regexp</artifactId>
  <version>0.2.3</version>
</dependency>

Any snapshots would be hosted in the Sonatype snapshot repository.

Build

To build named-regexp from source, use Maven 2 or higher:

$ git clone git://github.com/tony19/named-regexp.git
$ cd named-regexp
$ mvn package

Support

Feel free to ask any questions at named-regexp@googlegroups.com. Please report any issues in JIRA.

License

Copyright 2013 Anthony Trinh.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

githalytics.com alpha

About

Named capture groups for Java 5/6 regular expressions

Resources

License

Packages

No packages published
You can’t perform that action at this time.