public final 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.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 |
|---|---|
static class |
RegexResult.RegexResultGetStartNode |
| Modifier | Constructor and Description |
|---|---|
protected |
RegexResult(Object input,
int fromIndex,
int start,
int end,
int[] indices,
com.oracle.truffle.api.CallTarget lazyCallTarget) |
| Modifier and Type | Method and Description |
|---|---|
static RegexResult |
create(int[] indices) |
static RegexResult |
create(int start,
int end) |
static RegexResult |
create(Object input,
int[] indices) |
static RegexResult |
createLazy(Object input,
int fromIndex,
int start,
int end,
com.oracle.truffle.api.CallTarget lazyCallTarget) |
void |
debugForceEvaluation() |
int |
getEnd() |
int |
getEnd(int groupNumber) |
int |
getFromIndex() |
Object |
getInput() |
TruffleReadOnlyKeysArray |
getKeys() |
Object |
getMembers(boolean includeInternal) |
static RegexResult |
getNoMatchInstance() |
int |
getStart() |
int |
getStart(int groupNumber) |
Object |
readMemberImpl(String symbol) |
void |
setIndices(int[] indices) |
Object |
toDisplayString(boolean allowSideEffects) |
String |
toString() |
hasMembersgetLanguage, hasLanguageprotected RegexResult(Object input, int fromIndex, int start, int end, int[] indices, com.oracle.truffle.api.CallTarget lazyCallTarget)
public static RegexResult getNoMatchInstance()
public static RegexResult create(int start, int end)
public static RegexResult create(int[] indices)
public static RegexResult create(Object input, int[] indices)
public static RegexResult createLazy(Object input, int fromIndex, int start, int end, com.oracle.truffle.api.CallTarget lazyCallTarget)
public Object getInput()
public int getFromIndex()
public int getStart()
public int getEnd()
public void setIndices(int[] indices)
public int getStart(int groupNumber)
public int getEnd(int groupNumber)
public Object getMembers(boolean includeInternal)
getMembers in class AbstractConstantKeysObjectpublic TruffleReadOnlyKeysArray getKeys()
getKeys in class AbstractConstantKeysObjectpublic Object readMemberImpl(String symbol) throws com.oracle.truffle.api.interop.UnknownIdentifierException
readMemberImpl in class AbstractConstantKeysObjectcom.oracle.truffle.api.interop.UnknownIdentifierExceptionpublic void debugForceEvaluation()
public Object toDisplayString(boolean allowSideEffects)
toDisplayString in class AbstractRegexObject