All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ingerlflori.util.regex.Capture Maven / Gradle / Ivy

Go to download

This is a Regular Expressions library. Compared to the Regular Expressions library shipped with the Java JDK, it supports Recursive and Condititional Regular Expressions and adopts the concept of Captures from .Net

The newest version!
package com.ingerlflori.util.regex;

/**
 * The result of a successfull group capture.
 *
 * 

* One group can be matched multiple times, e.g. if you apply the regex (a)+ to * the input string aaaa, then there are 4 Capture objects * associated with group 1. * * @author Florian Ingerl * @see Matcher */ public class Capture implements Cloneable { private CharSequence text; private int start; private int end; Capture(CharSequence text, int start, int end) { this.text = text; this.start = start; this.end = end; } public int getStart() { return start; } public int getEnd() { return end; } public String getValue() { return text.subSequence(start, end).toString(); } @Override public Capture clone() { return new Capture(this.text, this.start, this.end); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy