Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class Matcher
- Object
- Matcher
ImplementsMatchResult
The same shape as java.util.regex.Matcher, over this package’s Pattern.
Everything a match is read through is here – matches, lookingAt,
find, groups by number and by name, regions, and the replacement
methods with the JDK’s $1 and ${name} syntax. hitEnd,
requireEnd and the two bounds switches are not provided.
Methods
Inherited methods
Method details
pattern
public Pattern pattern()usePattern
public Matcher usePattern(Pattern newPattern)reset
public Matcher reset()reset
public Matcher reset(CharSequence input)region
public Matcher region(int start, int end)regionStart
public int regionStart()regionEnd
public int regionEnd()matches
public boolean matches()lookingAt
public boolean lookingAt()find
public boolean find()find
public boolean find(int start)hasMatch
public boolean hasMatch()start
public int start()start
public int start(int group)start
public int start(String name)end
public int end()end
public int end(int group)end
public int end(String name)group
public String group()group
public String group(int group)group
public String group(String name)groupCount
public int groupCount()toMatchResult
public MatchResult toMatchResult()results
public Stream<MatchResult> results()Each match from here on, as toMatchResult() would answer it: from
after the last match found, or from the start of the region when
there is none. The matcher is not reset, so a match already consumed
is not answered again and a region stays in force.
Lazy, as the JDK’s is: each match is found only when the stream asks
for it, so results().limit(1) scans no further than the first.
quoteReplacement
public static String quoteReplacement(String s)$ and backslash stand for themselves.appendReplacement
public Matcher appendReplacement(StringBuilder sb, String replacement)appendReplacement
public Matcher appendReplacement(StringBuffer sb, String replacement)appendTail
public StringBuilder appendTail(StringBuilder sb)appendTail
public StringBuffer appendTail(StringBuffer sb)replaceAll
public String replaceAll(String replacement)replaceAll
public String replaceAll(Function<MatchResult, String> replacer)replaceFirst
public String replaceFirst(String replacement)replaceFirst
public String replaceFirst(Function<MatchResult, String> replacer)toString
public String toString()