Ruby: RMatch Struct Reference

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

Data Fields
RMatch Struct Reference

Regular expression execution context. More...

`#include <rmatch.h>`

## Data Fields
struct RBasic | basic
| Basic part, including flags and class.
VALUE | str
| The target string that the match was made against.
struct rmatch * | rmatch
| The result of this match.
VALUE | regexp
| The expression of this match.

## Detailed Description

Regular expression execution context.

When a regular expression "matches" to a string, it generates capture groups etc. This struct holds that info. Visible from Ruby as an instance of `MatchData`.

Note
  There is no way for extension libraries to manually generate this struct except by actually exercising the match operation of a regular expression.

Definition at line 94 of file rmatch.h.

## Field Documentation

## ◆ basic

struct RBasic RMatch::basic

Basic part, including flags and class.

Definition at line 97 of file rmatch.h.

## ◆ regexp

VALUE RMatch::regexp

The expression of this match.

Definition at line 112 of file rmatch.h.

## ◆ rmatch

struct rmatch* RMatch::rmatch

The result of this match.

Definition at line 107 of file rmatch.h.

## ◆ str

VALUE RMatch::str

The target string that the match was made against.

Definition at line 102 of file rmatch.h.

The documentation for this struct was generated from the following file:

- include/ruby/internal/core/rmatch.h