public class RubyRegexp extends RubyObject implements ReOptions, EncodingCapable, MarshalEncoding
| Modifier and Type | Class and Description |
|---|---|
private static class |
RubyRegexp.ErrorMode |
private static class |
RubyRegexp.SearchMatchTask |
RubyObject.DataRubyBasicObject.Finalizer| Modifier and Type | Field and Description |
|---|---|
static int |
ARG_ENCODING_FIXED |
static int |
ARG_ENCODING_NONE |
private static int |
EMBEDDABLE |
private static java.lang.String[] |
NO_NAMES |
private RegexpOptions |
options |
private org.joni.Regex |
pattern |
private static WeakValuedMap<org.jruby.util.ByteList,org.joni.Regex> |
patternCache |
private static WeakValuedMap<org.jruby.util.ByteList,org.joni.Regex> |
preprocessedPatternCache |
private static int |
QUOTED_V |
private static WeakValuedMap<org.jruby.util.ByteList,org.joni.Regex> |
quotedPatternCache |
private static ObjectAllocator |
REGEXP_ALLOCATOR |
private org.jruby.util.ByteList |
str |
FIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_ALLOCATOR, REIFYING_OBJECT_ALLOCATORALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, VAR_TABLE_OFFSET, varTable, varTableStampRE_DEFAULT, RE_FIXED, RE_LITERAL, RE_MAY_IGNORECASE, RE_OPTION_EXTENDED, RE_OPTION_IGNORECASE, RE_OPTION_LONGEST, RE_OPTION_MULTILINE, RE_OPTION_ONCE, RE_OPTION_POSIXLINE, RE_OPTION_SINGLELINE, RE_UNICODENULL_ARRAY| Modifier | Constructor and Description |
|---|---|
private |
RubyRegexp(Ruby runtime)
default constructor
|
private |
RubyRegexp(Ruby runtime,
org.jruby.util.ByteList str) |
private |
RubyRegexp(Ruby runtime,
org.jruby.util.ByteList str,
RegexpOptions options) |
private |
RubyRegexp(Ruby runtime,
RubyClass klass)
used by allocator
|
| Modifier and Type | Method and Description |
|---|---|
(package private) int |
adjustStartPos(RubyString str,
int pos,
boolean reverse) |
(package private) int |
adjustStartPos19(RubyString str,
int pos,
boolean reverse) |
private int |
adjustStartPosInternal(RubyString str,
org.jcodings.Encoding enc,
int pos,
boolean reverse) |
private static void |
appendOptions(org.jruby.util.ByteList to,
RegexpOptions options) |
private static void |
appendRegexpString(Ruby runtime,
org.jruby.util.ByteList to,
byte[] bytes,
int start,
int len,
org.jcodings.Encoding enc) |
private static void |
appendRegexpString19(Ruby runtime,
org.jruby.util.ByteList to,
byte[] bytes,
int start,
int len,
org.jcodings.Encoding enc,
org.jcodings.Encoding resEnc) |
private static void |
appendUtf8(Ruby runtime,
org.jruby.util.ByteList to,
int code,
org.jcodings.Encoding[] enc,
org.jruby.util.ByteList str,
RubyRegexp.ErrorMode mode)
Append the given utf8 characters to the buffer, if given, checking for
errors along the way.
|
IRubyObject |
casefold_p(ThreadContext context) |
private void |
check() |
private org.jcodings.Encoding |
checkEncoding(RubyString str,
boolean warn) |
private static void |
checkUnicodeRange(Ruby runtime,
int code,
org.jruby.util.ByteList str,
RubyRegexp.ErrorMode mode) |
void |
clearEncodingNone() |
void |
clearLiteral() |
(package private) static RubyMatchData |
createMatchData(ThreadContext context,
RubyString str,
org.joni.Matcher matcher,
org.joni.Regex pattern) |
(package private) static RubyMatchData |
createMatchData19(ThreadContext context,
RubyString str,
org.joni.Matcher matcher,
org.joni.Regex pattern) |
static RubyClass |
createRegexpClass(Ruby runtime) |
IRubyObject |
encoding(ThreadContext context) |
private static void |
encodingMatchError(Ruby runtime,
org.joni.Regex pattern,
org.jcodings.Encoding strEnc) |
IRubyObject |
eqq(ThreadContext context,
IRubyObject arg)
rb_reg_eqq
|
IRubyObject |
eqq19(ThreadContext context,
IRubyObject arg) |
IRubyObject |
fixed_encoding_p(ThreadContext context) |
org.jcodings.Encoding |
getEncoding() |
private org.jcodings.Encoding |
getEncoding(Ruby runtime,
org.jruby.util.ByteList str) |
KCode |
getKCode() |
org.jcodings.Encoding |
getMarshalEncoding() |
java.lang.String[] |
getNames() |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
RegexpOptions |
getOptions()
rb_reg_options
|
org.joni.Regex |
getPattern() |
private static org.joni.Regex |
getPreprocessedRegexpFromCache(Ruby runtime,
org.jruby.util.ByteList bytes,
org.jcodings.Encoding enc,
RegexpOptions options,
RubyRegexp.ErrorMode mode) |
(package private) static org.joni.Regex |
getQuotedRegexpFromCache(Ruby runtime,
org.jruby.util.ByteList bytes,
org.jcodings.Encoding enc,
RegexpOptions options) |
(package private) static org.joni.Regex |
getQuotedRegexpFromCache19(Ruby runtime,
org.jruby.util.ByteList bytes,
RegexpOptions options,
boolean asciiOnly) |
(package private) static org.joni.Regex |
getRegexpFromCache(Ruby runtime,
org.jruby.util.ByteList bytes,
org.jcodings.Encoding enc,
RegexpOptions options) |
RubyFixnum |
hash()
rb_obj_id
Will return the hash code of this object.
|
IRubyObject |
initialize_copy(IRubyObject re)
rb_reg_init_copy
|
IRubyObject |
initialize_m(IRubyObject arg) |
IRubyObject |
initialize_m(IRubyObject arg0,
IRubyObject arg1) |
IRubyObject |
initialize_m(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2) |
IRubyObject |
initialize_m19(IRubyObject arg) |
IRubyObject |
initialize_m19(IRubyObject arg0,
IRubyObject arg1) |
IRubyObject |
initialize_m19(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2) |
private IRubyObject |
initializeByRegexp(RubyRegexp regexp) |
private IRubyObject |
initializeByRegexp19(RubyRegexp regexp) |
private RubyRegexp |
initializeCommon(org.jruby.util.ByteList bytes,
RegexpOptions newOptions) |
private RubyRegexp |
initializeCommon19(org.jruby.util.ByteList bytes,
org.jcodings.Encoding enc,
RegexpOptions options) |
private RubyRegexp |
initializeCommon19(RubyString str,
RegexpOptions options) |
IRubyObject |
inspect()
rb_reg_inspect
|
IRubyObject |
inspect19() |
boolean |
isEncodingNone() |
boolean |
isKCodeDefault() |
boolean |
isLiteral() |
IRubyObject |
kcode(ThreadContext context) |
static IRubyObject |
last_match_s(ThreadContext context,
IRubyObject recv)
rb_reg_s_last_match / match_getter
|
static IRubyObject |
last_match_s(ThreadContext context,
IRubyObject recv,
IRubyObject nth)
rb_reg_s_last_match
|
static IRubyObject |
last_match_s(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
Deprecated.
Use the versions with zero, one, or two args.
|
static IRubyObject |
last_match(IRubyObject match)
rb_reg_last_match
|
(package private) int |
length() |
private static org.joni.Regex |
makeRegexp(Ruby runtime,
org.jruby.util.ByteList bytes,
RegexpOptions options,
org.jcodings.Encoding enc) |
static void |
marshalTo(RubyRegexp regexp,
MarshalStream output) |
static IRubyObject |
match_last(IRubyObject match)
rb_reg_match_last
|
IRubyObject |
match_m(ThreadContext context,
IRubyObject str)
rb_reg_match_m
|
IRubyObject |
match_m19(ThreadContext context,
IRubyObject str,
Block block) |
IRubyObject |
match_m19(ThreadContext context,
IRubyObject str,
boolean useBackref,
Block block) |
IRubyObject |
match_m19(ThreadContext context,
IRubyObject str,
IRubyObject pos,
Block block) |
static IRubyObject |
match_post(IRubyObject match)
rb_reg_match_post
|
static IRubyObject |
match_pre(IRubyObject match)
rb_reg_match_pre
|
private IRubyObject |
match19Common(ThreadContext context,
IRubyObject arg,
int pos,
boolean setBackref,
Block block) |
static int |
matcherMatch(Ruby runtime,
org.joni.Matcher matcher,
int start,
int range,
int option) |
static int |
matcherSearch(Ruby runtime,
org.joni.Matcher matcher,
int start,
int range,
int option) |
private int |
matchPos(ThreadContext context,
RubyString str,
int pos,
IRubyObject[] holder) |
IRubyObject |
named_captures(ThreadContext context)
rb_reg_named_captures
|
IRubyObject |
names(ThreadContext context)
rb_reg_names
|
static RubyRegexp |
newDRegexp(Ruby runtime,
RubyString pattern,
int joniOptions) |
static RubyRegexp |
newDRegexp(Ruby runtime,
RubyString pattern,
RegexpOptions options) |
static RubyRegexp |
newDRegexpEmbedded(Ruby runtime,
RubyString pattern,
int embeddedOptions) |
static RubyRegexp |
newDRegexpEmbedded19(Ruby runtime,
IRubyObject[] strings,
int embeddedOptions) |
(package private) static RubyRegexp |
newDummyRegexp(Ruby runtime,
org.joni.Regex regex) |
static RubyRegexp |
newInstance(IRubyObject recv,
IRubyObject[] args)
Deprecated.
|
static RubyRegexp |
newRegexp(Ruby runtime,
org.jruby.util.ByteList pattern) |
(package private) static RubyRegexp |
newRegexp(Ruby runtime,
org.jruby.util.ByteList str,
org.joni.Regex pattern) |
static RubyRegexp |
newRegexp(Ruby runtime,
org.jruby.util.ByteList pattern,
RegexpOptions options) |
static RubyRegexp |
newRegexp(Ruby runtime,
java.lang.String pattern,
RegexpOptions options) |
static IRubyObject |
nth_match(int nth,
IRubyObject match)
rb_reg_nth_match
|
private int |
objectAsJoniOptions(IRubyObject arg) |
IRubyObject |
op_equal(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_match(ThreadContext context,
IRubyObject str)
rb_reg_match
|
IRubyObject |
op_match19(ThreadContext context,
IRubyObject arg) |
IRubyObject |
op_match2_19(ThreadContext context) |
IRubyObject |
op_match2(ThreadContext context) |
private static RubyString |
operandCheck(Ruby runtime,
IRubyObject str) |
private static IRubyObject |
operandNoCheck(IRubyObject str) |
IRubyObject |
options() |
(package private) static org.joni.Regex |
preparePattern(Ruby runtime,
org.joni.Regex pattern,
RubyString str) |
org.joni.Regex |
preparePattern(RubyString str) |
private static org.jruby.util.ByteList |
preprocess(Ruby runtime,
org.jruby.util.ByteList str,
org.jcodings.Encoding enc,
org.jcodings.Encoding[] fixedEnc,
RubyRegexp.ErrorMode mode)
Preprocess the given string for use in regexp, raising errors for encoding
incompatibilities that arise.
|
static void |
preprocessCheck(Ruby runtime,
org.jruby.util.ByteList bytes) |
static RubyString |
preprocessDRegexp(Ruby runtime,
IRubyObject[] strings,
RegexpOptions options) |
private static void |
preprocessLight(Ruby runtime,
org.jruby.util.ByteList str,
org.jcodings.Encoding enc,
org.jcodings.Encoding[] fixedEnc,
RubyRegexp.ErrorMode mode)
Preprocess the given string for use in regexp, raising errors for encoding
incompatibilities that arise.
|
private static org.jruby.util.ByteList |
quote(org.jruby.util.ByteList bs,
org.jcodings.Encoding enc)
rb_reg_quote
|
static RubyString |
quote(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
rb_reg_s_quote
|
(package private) static org.jruby.util.ByteList |
quote19(org.jruby.util.ByteList bs,
boolean asciiOnly) |
static IRubyObject |
quote19(ThreadContext context,
IRubyObject recv,
IRubyObject arg) |
private static int |
raisePreprocessError(Ruby runtime,
org.jruby.util.ByteList str,
java.lang.String err,
RubyRegexp.ErrorMode mode) |
private static void |
raiseRegexpError(Ruby runtime,
org.jruby.util.ByteList bytes,
org.jcodings.Encoding enc,
RegexpOptions options,
java.lang.String err) |
private static void |
raiseRegexpError19(Ruby runtime,
org.jruby.util.ByteList bytes,
org.jcodings.Encoding enc,
RegexpOptions options,
java.lang.String err) |
private static int |
readEscapedByte(Ruby runtime,
byte[] to,
int toP,
byte[] bytes,
int p,
int end,
org.jruby.util.ByteList str,
RubyRegexp.ErrorMode mode) |
private static org.jruby.util.ByteList |
regexpDescription(Ruby runtime,
byte[] bytes,
int start,
int len,
org.jcodings.Encoding enc,
RegexpOptions options) |
private static org.jruby.util.ByteList |
regexpDescription(Ruby runtime,
org.jruby.util.ByteList bytes,
org.jcodings.Encoding enc,
RegexpOptions options) |
private static org.jruby.util.ByteList |
regexpDescription19(Ruby runtime,
byte[] s,
int start,
int len,
RegexpOptions options,
org.jcodings.Encoding enc) |
(package private) static org.jruby.util.ByteList |
regexpDescription19(Ruby runtime,
org.jruby.util.ByteList bytes,
RegexpOptions options,
org.jcodings.Encoding enc) |
(package private) static RubyString |
regsub(RubyString str,
RubyString src,
org.joni.Matcher matcher,
org.jcodings.Encoding enc) |
(package private) static RubyString |
regsub19(RubyString str,
RubyString src,
org.joni.Matcher matcher,
org.joni.Regex pattern) |
int |
search(ThreadContext context,
RubyString str,
int pos,
boolean reverse,
IRubyObject[] holder)
rb_reg_search
|
int |
search19(ThreadContext context,
RubyString str,
int pos,
boolean reverse,
IRubyObject[] holder) |
void |
setEncoding(org.jcodings.Encoding encoding) |
void |
setEncodingNone() |
void |
setLiteral() |
boolean |
shouldMarshalEncoding() |
IRubyObject |
source()
rb_reg_source
|
IRubyObject |
to_s()
rb_any_to_s
call-seq:
obj.to_s => string
Returns a string representing obj.
|
static IRubyObject |
try_convert(ThreadContext context,
IRubyObject recv,
IRubyObject args) |
private static int |
unescapeEscapedNonAscii(Ruby runtime,
org.jruby.util.ByteList to,
byte[] bytes,
int p,
int end,
org.jcodings.Encoding enc,
org.jcodings.Encoding[] encp,
org.jruby.util.ByteList str,
RubyRegexp.ErrorMode mode)
Unescape escaped non-ascii character at start position, appending all
to the given bytelist if provided.
|
private static boolean |
unescapeNonAscii(Ruby runtime,
org.jruby.util.ByteList to,
byte[] bytes,
int p,
int end,
org.jcodings.Encoding enc,
org.jcodings.Encoding[] encp,
org.jruby.util.ByteList str,
RubyRegexp.ErrorMode mode)
Unescape non-ascii elements in the given string, appending the results
to the given bytelist if provided.
|
private static int |
unescapeUnicodeBmp(Ruby runtime,
org.jruby.util.ByteList to,
byte[] bytes,
int p,
int end,
org.jcodings.Encoding[] encp,
org.jruby.util.ByteList str,
RubyRegexp.ErrorMode mode)
Unescape unicode BMP char at given offset, appending to the specified
buffer if non-null.
|
private static int |
unescapeUnicodeList(Ruby runtime,
org.jruby.util.ByteList to,
byte[] bytes,
int p,
int end,
org.jcodings.Encoding[] encp,
org.jruby.util.ByteList str,
RubyRegexp.ErrorMode mode)
Unescape unicode characters at given offset, appending to the given
out buffer if provided.
|
static IRubyObject |
union(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
rb_reg_s_union
|
static IRubyObject |
union19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args) |
static RubyRegexp |
unmarshalFrom(UnmarshalStream input) |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, hashCode, initialize, initialize, inspect, op_eqq, puts, specificEval, toStringaddFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getNativeHandle, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, infectBy, infectBy, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, op_cmp, op_equal_19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, toJava, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderprivate org.joni.Regex pattern
private org.jruby.util.ByteList str
private RegexpOptions options
public static final int ARG_ENCODING_FIXED
public static final int ARG_ENCODING_NONE
private static final WeakValuedMap<org.jruby.util.ByteList,org.joni.Regex> patternCache
private static final WeakValuedMap<org.jruby.util.ByteList,org.joni.Regex> quotedPatternCache
private static final WeakValuedMap<org.jruby.util.ByteList,org.joni.Regex> preprocessedPatternCache
private static ObjectAllocator REGEXP_ALLOCATOR
private static final int QUOTED_V
private static final int EMBEDDABLE
private static java.lang.String[] NO_NAMES
private RubyRegexp(Ruby runtime)
private RubyRegexp(Ruby runtime, org.jruby.util.ByteList str)
private RubyRegexp(Ruby runtime, org.jruby.util.ByteList str, RegexpOptions options)
public void setLiteral()
public void clearLiteral()
public boolean isLiteral()
public boolean isKCodeDefault()
public void setEncodingNone()
public void clearEncodingNone()
public boolean isEncodingNone()
public KCode getKCode()
public org.jcodings.Encoding getEncoding()
getEncoding in interface EncodingCapablepublic void setEncoding(org.jcodings.Encoding encoding)
setEncoding in interface EncodingCapablepublic boolean shouldMarshalEncoding()
shouldMarshalEncoding in interface MarshalEncodingpublic org.jcodings.Encoding getMarshalEncoding()
getMarshalEncoding in interface MarshalEncodingprivate static org.joni.Regex makeRegexp(Ruby runtime, org.jruby.util.ByteList bytes, RegexpOptions options, org.jcodings.Encoding enc)
static org.joni.Regex getRegexpFromCache(Ruby runtime, org.jruby.util.ByteList bytes, org.jcodings.Encoding enc, RegexpOptions options)
static org.joni.Regex getQuotedRegexpFromCache(Ruby runtime, org.jruby.util.ByteList bytes, org.jcodings.Encoding enc, RegexpOptions options)
static org.joni.Regex getQuotedRegexpFromCache19(Ruby runtime, org.jruby.util.ByteList bytes, RegexpOptions options, boolean asciiOnly)
private static org.joni.Regex getPreprocessedRegexpFromCache(Ruby runtime, org.jruby.util.ByteList bytes, org.jcodings.Encoding enc, RegexpOptions options, RubyRegexp.ErrorMode mode)
public static int matcherSearch(Ruby runtime, org.joni.Matcher matcher, int start, int range, int option)
public static int matcherMatch(Ruby runtime, org.joni.Matcher matcher, int start, int range, int option)
public int getNativeTypeIndex()
RubyObjectgetNativeTypeIndex in interface CoreObjectTypegetNativeTypeIndex in class RubyObjectClassIndexprivate org.jcodings.Encoding getEncoding(Ruby runtime, org.jruby.util.ByteList str)
public static RubyRegexp newRegexp(Ruby runtime, java.lang.String pattern, RegexpOptions options)
public static RubyRegexp newRegexp(Ruby runtime, org.jruby.util.ByteList pattern, RegexpOptions options)
public static RubyRegexp newDRegexp(Ruby runtime, RubyString pattern, RegexpOptions options)
public static RubyRegexp newDRegexp(Ruby runtime, RubyString pattern, int joniOptions)
public static RubyRegexp newDRegexpEmbedded(Ruby runtime, RubyString pattern, int embeddedOptions)
public static RubyRegexp newDRegexpEmbedded19(Ruby runtime, IRubyObject[] strings, int embeddedOptions)
public static RubyRegexp newRegexp(Ruby runtime, org.jruby.util.ByteList pattern)
static RubyRegexp newRegexp(Ruby runtime, org.jruby.util.ByteList str, org.joni.Regex pattern)
static RubyRegexp newDummyRegexp(Ruby runtime, org.joni.Regex regex)
public RegexpOptions getOptions()
public final org.joni.Regex getPattern()
private static void encodingMatchError(Ruby runtime, org.joni.Regex pattern, org.jcodings.Encoding strEnc)
private org.jcodings.Encoding checkEncoding(RubyString str, boolean warn)
public final org.joni.Regex preparePattern(RubyString str)
static org.joni.Regex preparePattern(Ruby runtime, org.joni.Regex pattern, RubyString str)
private static int raisePreprocessError(Ruby runtime, org.jruby.util.ByteList str, java.lang.String err, RubyRegexp.ErrorMode mode)
private static int readEscapedByte(Ruby runtime, byte[] to, int toP, byte[] bytes, int p, int end, org.jruby.util.ByteList str, RubyRegexp.ErrorMode mode)
private static int unescapeEscapedNonAscii(Ruby runtime, org.jruby.util.ByteList to, byte[] bytes, int p, int end, org.jcodings.Encoding enc, org.jcodings.Encoding[] encp, org.jruby.util.ByteList str, RubyRegexp.ErrorMode mode)
runtime - current runtimeto - output bytelist; if null, no appending will be donebytes - incoming bytesp - start positionend - end positionenc - bytes' encodingencp - out param for fixed encodingstr - original bytes wrappermode - error modeprivate static void checkUnicodeRange(Ruby runtime, int code, org.jruby.util.ByteList str, RubyRegexp.ErrorMode mode)
private static void appendUtf8(Ruby runtime, org.jruby.util.ByteList to, int code, org.jcodings.Encoding[] enc, org.jruby.util.ByteList str, RubyRegexp.ErrorMode mode)
runtime - current runtimeto - output buffer; if null, no appending will be donecode - utf8 character codeenc - output param for new encodingstr - original wrapper of source bytesmode - error modeprivate static int unescapeUnicodeList(Ruby runtime, org.jruby.util.ByteList to, byte[] bytes, int p, int end, org.jcodings.Encoding[] encp, org.jruby.util.ByteList str, RubyRegexp.ErrorMode mode)
runtime - current runtimeto - output buffer; if null, no appending will be donebytes - input bytesp - start positionend - end positionencp - out param for fixed encodingstr - original bytes wrappermode - error modeprivate static int unescapeUnicodeBmp(Ruby runtime, org.jruby.util.ByteList to, byte[] bytes, int p, int end, org.jcodings.Encoding[] encp, org.jruby.util.ByteList str, RubyRegexp.ErrorMode mode)
runtime - current runtimeto - output buffer; if null, no appending will be donebytes - input bytesp - start positionend - end positionencp - out param for fixed encodingstr - original bytes wrappermode - error modeprivate static boolean unescapeNonAscii(Ruby runtime, org.jruby.util.ByteList to, byte[] bytes, int p, int end, org.jcodings.Encoding enc, org.jcodings.Encoding[] encp, org.jruby.util.ByteList str, RubyRegexp.ErrorMode mode)
runtime - current runtimeto - output bytelist; if null, no appending will be donebytes - the bytes to unescapep - starting positionend - ending positionenc - bytes' encodingencp - out param for fixed encodingstr - original wrapper for the bytesmode - error modeprivate static org.jruby.util.ByteList preprocess(Ruby runtime, org.jruby.util.ByteList str, org.jcodings.Encoding enc, org.jcodings.Encoding[] fixedEnc, RubyRegexp.ErrorMode mode)
runtime - current runtimestr - string to preprocessenc - string's encodingfixedEnc - new encoding after fixingmode - mode of errorsprivate static void preprocessLight(Ruby runtime, org.jruby.util.ByteList str, org.jcodings.Encoding enc, org.jcodings.Encoding[] fixedEnc, RubyRegexp.ErrorMode mode)
runtime - current runtimestr - string to preprocessenc - string's encodingfixedEnc - new encoding after fixingmode - mode of errorspublic static void preprocessCheck(Ruby runtime, org.jruby.util.ByteList bytes)
public static RubyString preprocessDRegexp(Ruby runtime, IRubyObject[] strings, RegexpOptions options)
private void check()
public static IRubyObject try_convert(ThreadContext context, IRubyObject recv, IRubyObject args)
public static RubyString quote(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject quote19(ThreadContext context, IRubyObject recv, IRubyObject arg)
private static org.jruby.util.ByteList quote(org.jruby.util.ByteList bs,
org.jcodings.Encoding enc)
static org.jruby.util.ByteList quote19(org.jruby.util.ByteList bs,
boolean asciiOnly)
public static IRubyObject last_match_s(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject last_match_s(ThreadContext context, IRubyObject recv)
public static IRubyObject last_match_s(ThreadContext context, IRubyObject recv, IRubyObject nth)
public static IRubyObject union(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject union19(ThreadContext context, IRubyObject recv, IRubyObject[] args)
private static void raiseRegexpError(Ruby runtime, org.jruby.util.ByteList bytes, org.jcodings.Encoding enc, RegexpOptions options, java.lang.String err)
private static org.jruby.util.ByteList regexpDescription(Ruby runtime, org.jruby.util.ByteList bytes, org.jcodings.Encoding enc, RegexpOptions options)
private static org.jruby.util.ByteList regexpDescription(Ruby runtime, byte[] bytes, int start, int len, org.jcodings.Encoding enc, RegexpOptions options)
private static void raiseRegexpError19(Ruby runtime, org.jruby.util.ByteList bytes, org.jcodings.Encoding enc, RegexpOptions options, java.lang.String err)
static org.jruby.util.ByteList regexpDescription19(Ruby runtime, org.jruby.util.ByteList bytes, RegexpOptions options, org.jcodings.Encoding enc)
private static org.jruby.util.ByteList regexpDescription19(Ruby runtime, byte[] s, int start, int len, RegexpOptions options, org.jcodings.Encoding enc)
public IRubyObject initialize_copy(IRubyObject re)
initialize_copy in class RubyBasicObjectprivate int objectAsJoniOptions(IRubyObject arg)
public IRubyObject initialize_m(IRubyObject arg)
public IRubyObject initialize_m(IRubyObject arg0, IRubyObject arg1)
public IRubyObject initialize_m(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
private IRubyObject initializeByRegexp(RubyRegexp regexp)
private RubyRegexp initializeCommon(org.jruby.util.ByteList bytes, RegexpOptions newOptions)
public IRubyObject initialize_m19(IRubyObject arg)
public IRubyObject initialize_m19(IRubyObject arg0, IRubyObject arg1)
public IRubyObject initialize_m19(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
private IRubyObject initializeByRegexp19(RubyRegexp regexp)
private RubyRegexp initializeCommon19(RubyString str, RegexpOptions options)
private RubyRegexp initializeCommon19(org.jruby.util.ByteList bytes, org.jcodings.Encoding enc, RegexpOptions options)
public IRubyObject kcode(ThreadContext context)
public RubyFixnum hash()
RubyBasicObjecthash in class RubyBasicObjectpublic IRubyObject op_equal(ThreadContext context, IRubyObject other)
op_equal in interface IRubyObjectop_equal in class RubyBasicObjectpublic IRubyObject op_match2(ThreadContext context)
public IRubyObject op_match2_19(ThreadContext context)
public IRubyObject eqq(ThreadContext context, IRubyObject arg)
public IRubyObject eqq19(ThreadContext context, IRubyObject arg)
public IRubyObject op_match(ThreadContext context, IRubyObject str)
op_match in class RubyBasicObjectpublic IRubyObject op_match19(ThreadContext context, IRubyObject arg)
op_match19 in class RubyBasicObjectpublic IRubyObject match_m(ThreadContext context, IRubyObject str)
public IRubyObject match_m19(ThreadContext context, IRubyObject str, Block block)
public IRubyObject match_m19(ThreadContext context, IRubyObject str, boolean useBackref, Block block)
public IRubyObject match_m19(ThreadContext context, IRubyObject str, IRubyObject pos, Block block)
private IRubyObject match19Common(ThreadContext context, IRubyObject arg, int pos, boolean setBackref, Block block)
private int matchPos(ThreadContext context, RubyString str, int pos, IRubyObject[] holder)
public final int search(ThreadContext context, RubyString str, int pos, boolean reverse, IRubyObject[] holder)
static final RubyMatchData createMatchData(ThreadContext context, RubyString str, org.joni.Matcher matcher, org.joni.Regex pattern)
public final int search19(ThreadContext context, RubyString str, int pos, boolean reverse, IRubyObject[] holder)
static final RubyMatchData createMatchData19(ThreadContext context, RubyString str, org.joni.Matcher matcher, org.joni.Regex pattern)
public IRubyObject options()
public IRubyObject casefold_p(ThreadContext context)
public IRubyObject source()
final int length()
public IRubyObject inspect()
inspect in interface IRubyObjectinspect in class RubyBasicObjectpublic IRubyObject inspect19()
public IRubyObject to_s()
RubyBasicObjectto_s prints the object's class and an encoding of the
object id. As a special case, the top-level object that is the
initial execution context of Ruby programs returns ``main.''to_s in class RubyBasicObjectprivate static void appendRegexpString(Ruby runtime, org.jruby.util.ByteList to, byte[] bytes, int start, int len, org.jcodings.Encoding enc)
private static void appendRegexpString19(Ruby runtime, org.jruby.util.ByteList to, byte[] bytes, int start, int len, org.jcodings.Encoding enc, org.jcodings.Encoding resEnc)
private static void appendOptions(org.jruby.util.ByteList to,
RegexpOptions options)
public java.lang.String[] getNames()
public IRubyObject names(ThreadContext context)
public IRubyObject named_captures(ThreadContext context)
public IRubyObject encoding(ThreadContext context)
public IRubyObject fixed_encoding_p(ThreadContext context)
public static IRubyObject nth_match(int nth, IRubyObject match)
public static IRubyObject last_match(IRubyObject match)
public static IRubyObject match_pre(IRubyObject match)
public static IRubyObject match_post(IRubyObject match)
public static IRubyObject match_last(IRubyObject match)
static RubyString regsub(RubyString str, RubyString src, org.joni.Matcher matcher, org.jcodings.Encoding enc)
static RubyString regsub19(RubyString str, RubyString src, org.joni.Matcher matcher, org.joni.Regex pattern)
final int adjustStartPos19(RubyString str, int pos, boolean reverse)
final int adjustStartPos(RubyString str, int pos, boolean reverse)
private final int adjustStartPosInternal(RubyString str, org.jcodings.Encoding enc, int pos, boolean reverse)
private static IRubyObject operandNoCheck(IRubyObject str)
private static RubyString operandCheck(Ruby runtime, IRubyObject str)
public static RubyRegexp unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOExceptionpublic static void marshalTo(RubyRegexp regexp, MarshalStream output) throws java.io.IOException
java.io.IOException@Deprecated public static RubyRegexp newInstance(IRubyObject recv, IRubyObject[] args)