Package dev.comfast.rgx
Class RgxMatch
java.lang.Object
dev.comfast.rgx.RgxMatch
Represent one Regex match. Can be empty.
-
Field Details
-
ERR_MSG_MAX_LENGTH
public static final int ERR_MSG_MAX_LENGTH- See Also:
-
-
Constructor Details
-
RgxMatch
-
-
Method Details
-
get
- Returns:
- entire match.
-
get
- Returns:
- nth match group.
-
isPresent
public boolean isPresent()- Returns:
- true if match found
-
isEmpty
public boolean isEmpty()- Returns:
- true if match empty
-
getOrElse
- Returns:
- entire match or else default value
-
getOrElse
- Parameters:
nthGroup- group number, where 0 is entire matchelseValue- else default value- Returns:
- nthGroup or else default value
-
throwIfEmpty
Throws Exception with match details if match empty. -
throwIfEmpty
- Parameters:
failMsg- will throw only cause ExceptionmsgArgs- printf arguments for failMsg- Returns:
- this
-