Method Summary | |
---|---|
java.util.regex.Matcher
|
each(groovy.lang.Closure closure)
Process each matched substring of the given group matcher |
java.lang.Object
|
getAt(int idx)
Support the subscript operator, e |
java.lang.String
|
getAt(java.util.Collection indices)
Allows a List to be used as the indices to be used on a Matcher |
int
|
getCount()
Find the number of Strings matched to the given Matcher |
static java.util.regex.Matcher
|
getLastMatcher()
Get the last hidden matcher that system used to do a match |
boolean
|
hasGroup()
Check whether a Matcher contains a group or not |
java.util.Iterator
|
iterator()
|
void
|
setIndex(int idx)
Set the position of the given Matcher to the given index |
long
|
size()
Provide the standard Groovy size method for a matcher |
Method Detail |
---|
public java.util.regex.Matcher each(groovy.lang.Closure closure)
closure
- a closure.
public java.lang.Object getAt(int idx)
def p = /ab[d|f]/ def m = "abcabdabeabf" =~ p for (i in 0..
For an example using group matches, def p = /(?:ab([c|d|e|f]))/ def m = "abcabdabeabf" =~ p for (i in 0..
For another example using group matches, def m = "abcabdabeabfabxyzabx" =~ /(?:ab([d|x-z]+))/ m.count.times { println( "m.groupCount() = " + m.groupCount()) println( " " + it + ": " + m[it] ) // m[it] is a List }
idx
- an index.
public java.lang.String getAt(java.util.Collection indices)
indices
- a Collection of indices.
public int getCount()
public static java.util.regex.Matcher getLastMatcher()
public boolean hasGroup()
true
if matcher contains at least one group.public java.util.Iterator iterator()
public void setIndex(int idx)
idx
- the index number.
public long size()