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.int lastGroup: The index of the last capture group that was matched. -1 if no capture
group was matched. This property is only tracked for Python regular expressions. For other
flavors of regular expressions, this always has the value -1.| Modifier and Type | Class and Description |
|---|---|
static class |
RegexResult.RegexResultGetLastGroupNode |
static class |
RegexResult.RegexResultGetStartNode |
| Modifier | Constructor and Description |
|---|---|
protected |
RegexResult(com.oracle.truffle.api.strings.TruffleString input,
int fromIndex,
int start,
int end,
int[] result,
com.oracle.truffle.api.CallTarget lazyCallTarget) |
| Modifier and Type | Method and Description |
|---|---|
static RegexResult |
create(int[] result) |
static RegexResult |
create(int start,
int end) |
static RegexResult |
createFromExecutorResult(Object executorResult) |
static RegexResult |
createLazy(com.oracle.truffle.api.strings.TruffleString input,
int fromIndex,
int start,
int end,
com.oracle.truffle.api.CallTarget lazyCallTarget) |
void |
debugForceEvaluation() |
static RegexResult |
getBooleanMatchInstance() |
int |
getEnd() |
int |
getEnd(int groupNumber) |
int |
getFromIndex() |
com.oracle.truffle.api.strings.TruffleString |
getInput() |
TruffleReadOnlyKeysArray |
getKeys() |
int |
getLastGroup() |
Object |
getMembers(boolean includeInternal) |
static RegexResult |
getNoMatchInstance() |
int |
getStart() |
int |
getStart(int groupNumber) |
boolean |
isMemberReadableImpl(String symbol) |
Object |
readMemberImpl(String symbol) |
void |
setResult(int[] result) |
Object |
toDisplayString(boolean allowSideEffects) |
String |
toString() |
hasMemberscreateNamedCaptureGroupMapInt, createNamedCaptureGroupMapListInt, getLanguage, hasLanguageprotected RegexResult(com.oracle.truffle.api.strings.TruffleString input,
int fromIndex,
int start,
int end,
int[] result,
com.oracle.truffle.api.CallTarget lazyCallTarget)
public static RegexResult getNoMatchInstance()
public static RegexResult getBooleanMatchInstance()
public static RegexResult create(int start, int end)
public static RegexResult create(int[] result)
public static RegexResult createFromExecutorResult(Object executorResult)
public static RegexResult createLazy(com.oracle.truffle.api.strings.TruffleString input, int fromIndex, int start, int end, com.oracle.truffle.api.CallTarget lazyCallTarget)
public com.oracle.truffle.api.strings.TruffleString getInput()
public int getFromIndex()
public int getStart()
public int getEnd()
public void setResult(int[] result)
public int getStart(int groupNumber)
public int getEnd(int groupNumber)
public int getLastGroup()
public Object getMembers(boolean includeInternal)
getMembers in class AbstractConstantKeysObjectpublic TruffleReadOnlyKeysArray getKeys()
getKeys in class AbstractConstantKeysObjectpublic boolean isMemberReadableImpl(String symbol)
isMemberReadableImpl in class AbstractConstantKeysObjectpublic Object readMemberImpl(String symbol)
readMemberImpl in class AbstractConstantKeysObjectpublic void debugForceEvaluation()
public Object toDisplayString(boolean allowSideEffects)
toDisplayString in class AbstractRegexObject