public abstract class RegexResult extends AbstractConstantKeysObject
RegexResult is a TruffleObject that represents the result of matching a regular
expression against a string. It can be obtained as the result of a RegexObject's
exec method and has the following properties:
boolean isMatch: true if a match was found, false otherwise.int groupCount: number of capture groups present in the regular expression, including
group 0. If the result is no match, this property is undefined.TruffleObject getStart(int groupNumber): returns the position where the
beginning of the capture group with the given number was found. If the result is no match, the
returned value is undefined. Capture group number 0 denotes the boundaries of the entire
expression. If no match was found for a particular capture group, the returned value is
-1.TruffleObject end: returns the position where the end of the capture group
with the given number was found. If the result is no match, the returned value is undefined.
Capture group number 0 denotes the boundaries of the entire expression. If no match was
found for a particular capture group, the returned value is -1.| Modifier and Type | Class and Description |
|---|---|
class |
RegexResult.RegexResultGetEndMethod |
class |
RegexResult.RegexResultGetStartMethod |
AbstractConstantKeysObject.IsReadableCacheNode, AbstractConstantKeysObject.ReadCacheNode| Constructor and Description |
|---|
RegexResult() |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
getEnd(int groupNumber) |
TruffleReadOnlyKeysArray |
getKeys() |
abstract int |
getStart(int groupNumber) |
Object |
readMemberImpl(String symbol) |
getMembers, hasMembers, isMemberReadable, readMembergetLanguage, hasLanguage, toDisplayStringpublic abstract int getStart(int groupNumber)
public abstract int getEnd(int groupNumber)
public TruffleReadOnlyKeysArray getKeys()
getKeys in class AbstractConstantKeysObjectpublic final Object readMemberImpl(String symbol) throws com.oracle.truffle.api.interop.UnknownIdentifierException
readMemberImpl in class AbstractConstantKeysObjectcom.oracle.truffle.api.interop.UnknownIdentifierException