java.util.regex
4 classes of the module java.base.
Load them with:
using {
"java.util.regex"
}
Matcher#
class final · extends Object · java.util.regex.Matcher
Implements: MatchResult
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@@end | @@end(group) | int end(int group)int end(String name) |
@end | @end() | int end() |
@find | @find(start) | boolean find(int start) |
@group | @group(group) | String group(int group)String group(String name) |
@reset | @reset(input) | Matcher reset(CharSequence input) |
@start | @start(group) | int start(int group)int start(String name) |
appendReplacement | appendReplacement(sb,replacement) | Matcher appendReplacement(StringBuffer sb, String replacement)Matcher appendReplacement(StringBuilder sb, String replacement) |
appendTail | appendTail(sb) | StringBuffer appendTail(StringBuffer sb)StringBuilder appendTail(StringBuilder sb) |
find | find() | boolean find() |
group | group() | String group() |
groupCount | groupCount() | int groupCount() |
hasAnchoringBounds | hasAnchoringBounds() | boolean hasAnchoringBounds() |
hasMatch | hasMatch() | boolean hasMatch() |
hasTransparentBounds | hasTransparentBounds() | boolean hasTransparentBounds() |
hitEnd | hitEnd() | boolean hitEnd() |
lookingAt | lookingAt() | boolean lookingAt() |
matches | matches() | boolean matches() |
namedGroups | namedGroups() | Map namedGroups() |
pattern | pattern() | Pattern pattern() |
quoteReplacement | quoteReplacement(s) | static String quoteReplacement(String s) |
region | region(start,end) | Matcher region(int start, int end) |
regionEnd | regionEnd() | int regionEnd() |
regionStart | regionStart() | int regionStart() |
replaceAll | replaceAll(replacement) | String replaceAll(String replacement)String replaceAll(Function replacer) |
replaceFirst | replaceFirst(replacer) | String replaceFirst(Function replacer)String replaceFirst(String replacement) |
requireEnd | requireEnd() | boolean requireEnd() |
reset | reset() | Matcher reset() |
results | results() | Stream results() |
start | start() | int start() |
toMatchResult | toMatchResult() | MatchResult toMatchResult() |
useAnchoringBounds | useAnchoringBounds(b) | Matcher useAnchoringBounds(boolean b) |
usePattern | usePattern(newPattern) | Matcher usePattern(Pattern newPattern) |
useTransparentBounds | useTransparentBounds(b) | Matcher useTransparentBounds(boolean b) |
The methods and fields of Object are inherited.
MatchResult#
interface · java.util.regex.MatchResult
Methods
| Method | Ring call | Java overloads |
|---|---|---|
@@end | @@end(name) | int end(String name)int end(int group) |
@end | @end() | int end() |
@group | @group(group) | String group(int group)String group(String name) |
@start | @start(name) | int start(String name)int start(int group) |
group | group() | String group() |
groupCount | groupCount() | int groupCount() |
hasMatch | hasMatch() | boolean hasMatch() |
namedGroups | namedGroups() | Map namedGroups() |
start | start() | int start() |
Pattern#
class final · extends Object · java.util.regex.Pattern
Implements: Serializable
Fields
| Name | Type | Access | In Ring |
|---|---|---|---|
UNIX_LINES | int | constant · static | o.UNIX_LINES |
CASE_INSENSITIVE | int | constant · static | o.CASE_INSENSITIVE |
COMMENTS | int | constant · static | o.COMMENTS |
MULTILINE | int | constant · static | o.MULTILINE |
LITERAL | int | constant · static | o.LITERAL |
DOTALL | int | constant · static | o.DOTALL |
UNICODE_CASE | int | constant · static | o.UNICODE_CASE |
CANON_EQ | int | constant · static | o.CANON_EQ |
UNICODE_CHARACTER_CLASS | int | constant · static | o.UNICODE_CHARACTER_CLASS |
Methods
| Method | Ring call | Java overloads |
|---|---|---|
asMatchPredicate | asMatchPredicate() | Predicate asMatchPredicate() |
asPredicate | asPredicate() | Predicate asPredicate() |
compile | compile(regex)compile([regex,flags])compile([ :regex = v, :flags = v ]) | static Pattern compile(String regex)static Pattern compile(String regex, int flags) |
flags | flags() | int flags() |
matcher | matcher(input) | Matcher matcher(CharSequence input) |
matches | matches(regex,input) | static boolean matches(String regex, CharSequence input) |
namedGroups | namedGroups() | Map namedGroups() |
pattern | pattern() | String pattern() |
quote | quote(s) | static String quote(String s) |
split | split(input)split([input,limit])split([ :input = v, :limit = v ]) | String[] split(CharSequence input)String[] split(CharSequence input, int limit) |
splitAsStream | splitAsStream(input) | Stream splitAsStream(CharSequence input) |
splitWithDelimiters | splitWithDelimiters(input,limit) | String[] splitWithDelimiters(CharSequence input, int limit) |
The methods and fields of Object are inherited.
PatternSyntaxException#
class · extends IllegalArgumentException · java.util.regex.PatternSyntaxException
Constructors
new PatternSyntaxException(String desc, String regex, int index) |
Ring: new PatternSyntaxException(args) uses the constructor with the fewest parameters (at least one); new PatternSyntaxException makes the object with the constructor without parameters; the others: (new PatternSyntaxException).@New([ :param = value ]) or .@New([v1,v2]).
Methods
| Method | Ring call | Java overloads |
|---|---|---|
getDescription | getDescription() | String getDescription() |
getIndex | getIndex() | int getIndex() |
getPattern | getPattern() | String getPattern() |
The methods and fields of IllegalArgumentException are inherited.