Top Inners Fields Constructors Methods
org.jruby

public Class RubyMatchData

extends RubyObject
Class Inheritance
Annotations
@JRubyClass
name:MatchData
Imports
org.jcodings.Encoding, org.joni.Matcher, .NameEntry, .Regex, .Region, org.joni.exception.JOniException, .ValueException, org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.api.Create, org.jruby.ast.util.ArgsUtil, org.jruby.runtime.Arity, .Block, .ClassIndex, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.ByteList, .ByteListHolder, .RegexpOptions, .StringSupport, java.util.Arrays, .Iterator, java.util.stream.Stream, .StreamSupport

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv int
private Region
private boolean
pack-priv int
private static final int
private Object
pack-priv transient RubyRegexp
pack-priv Region
pack-priv RubyString
Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
public
public
RubyMatchData(Ruby runtime, RubyClass metaClass)

Method Summary

Modifier and TypeMethod and Description
public final IRubyObject
at(final int nth)
Deprecated since 10.0.

public final IRubyObject
at(ThreadContext context, final int nth)

public final int
backrefNumber(Ruby runtime, IRubyObject obj)
Deprecated since 10.0.

public final int
public static int
backrefNumber(Ruby runtime, Regex pattern, Region regs, IRubyObject obj)
Deprecated since 10.0.

public static int
backrefNumber(ThreadContext context, Regex pattern, Region regs, IRubyObject obj)

private void
public IRubyObject
begin(ThreadContext context, IRubyObject index)

MRI: match_begin

public int

Returns:

the begin offset for the region
begin
(int
the region for which to fetch the begin offset
i
)

Get the begin offset of the given region, or -1 if the region does not exist.

public IRubyObject
public IRubyObject
private static ByteList
public IRubyObject
public IRubyObject
captures(ThreadContext context)

match_captures

pack-priv final void
public void
public static RubyClass
public IRubyObject
public IRubyObject
public IRubyObject
end(ThreadContext context, IRubyObject index)

match_end

public int

Returns:

the end offset for the region
end
(int
the region for which to fetch the end offset
i
)

Get the end offset of the given region, or -1 if the region does not exist.

public IRubyObject
public boolean
equals(Object
object to compare
other
)

Overrides org.jruby.RubyObject.equals.

This override does not do a "checked" dispatch.

private Stream<NameEntry>
public IRubyObject[]
getNamedBackrefValues(Ruby runtime)
Deprecated since 10.0.

public int
getNameToBackrefNumber(String name)
Deprecated since 10.0.

public int
public ClassIndex
getNativeClassIndex()

Overrides org.jruby.RubyObject.getNativeClassIndex.

Implements org.jruby.runtime.marshal.CoreObjectType.getNativeClassIndex.

This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.

pack-priv final Regex
private RubyRegexp
public IRubyObject
group(long n)
Deprecated since 10.0.

public IRubyObject
group(int n)
Deprecated since 10.0.

public IRubyObject
group(ThreadContext context, int n)

public RubyFixnum
hash(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.hash.

Will return the hash code of this object.

public int
hashCode()

Overrides org.jruby.RubyObject.hashCode.

This override does not do "checked" dispatch since Object usually has #hash defined.

public IRubyObject
initialize_copy(ThreadContext
the thread context
context
,
IRubyObject
the original
original
)

Overrides org.jruby.RubyBasicObject.initialize_copy.

Initializes this object as a copy of the original, that is the parameter to this object.

pack-priv final void
initMatchData(RubyString str, Matcher matcher, Regex pattern)

pack-priv final void
initMatchData(RubyString str, int beg, RubyString pattern)

public RubyString
inspect()

Overrides org.jruby.RubyBasicObject.inspect.

Implements org.jruby.runtime.builtin.IRubyObject.inspect.

Deprecated since 10.0.

RubyMethod inspect.

public RubyString
inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Returns a string containing a human-readable representation of obj.

public IRubyObject
private RubyArray<?>
match_array(ThreadContext context, int start)

public IRubyObject
private IRubyObject
matchAryAref(ThreadContext context, IRubyObject index, RubyArray<T extends IRubyObject> result)

private IRubyObject
matchArySubseq(ThreadContext context, int beg, int len, RubyArray<T extends IRubyObject> result)

public RubyHash
named_captures(ThreadContext context)
Deprecated since 10.0.

public RubyHash
public IRubyObject
names(ThreadContext context, Block block)

private int
private int
private static int
private static int
private int
private int
public int

Returns:

the number of regions in this match
numRegs
()

Fetch the number of regions in this match.

public IRubyObject
offset(ThreadContext context, IRubyObject index)

match_offset

public IRubyObject
offset19(ThreadContext context, IRubyObject index)
Deprecated

public IRubyObject
op_aref(ThreadContext context, IRubyObject idx)

match_aref

public IRubyObject
op_aref(ThreadContext context, IRubyObject idx, IRubyObject rest)

match_aref

public IRubyObject
op_aref(IRubyObject idx)
Deprecated

public IRubyObject
op_aref(IRubyObject idx, IRubyObject rest)
Deprecated

private IRubyObject
public IRubyObject
post_match(ThreadContext context)

match_post_match

public IRubyObject
pre_match(ThreadContext context)

match_pre_match

public RubyRegexp
regexp(ThreadContext context, Block block)

public IRubyObject
size(ThreadContext context)

match_size

public IRubyObject
string()
Deprecated since 10.0.

public IRubyObject
string(ThreadContext context)

match_string

private RubyString
private RubySymbol
public RubyArray<T extends IRubyObject>
to_a(ThreadContext context)

Overrides org.jruby.RubyBasicObject.to_a.

match_to_a

public RubyArray<T extends IRubyObject>
to_a()

Overrides org.jruby.RubyBasicObject.to_a.

Deprecated

public IRubyObject
to_s(ThreadContext context)

Overrides org.jruby.RubyBasicObject.to_s.

match_to_s

private void
private void
private void
private static void
updatePairs(ByteList value, Encoding encoding, RubyMatchData.Pair[] pairs)

public final void
use()

public final boolean
used()

public IRubyObject
public IRubyObject
values_at(IRubyObject[] args)
Deprecated since 10.0.

Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalfinishObjectClassinspectop_eqqputsspecificEvaltoRubyStringtoString