Ruby 4.1.0dev (2026-05-26 revision d6fa8e3e0f876114bf4ab9c8961a8e10e32ac9db)
re.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_RE_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_RE_H
25#include "ruby/internal/value.h"
26
28
29/* re.c */
30
31
42#define rb_memcmp memcmp
43
60int rb_memcicmp(const void *s1,const void *s2, long n);
61
76void rb_match_busy(VALUE md);
77
92
103VALUE rb_reg_nth_match(int n, VALUE md);
104
116int rb_reg_backref_number(VALUE match, VALUE backref);
117
125
133
141
149
157#define HAVE_RB_REG_NEW_STR 1
158
168VALUE rb_reg_new_str(VALUE src, int opts);
169
179VALUE rb_reg_new(const char *src, long len, int opts);
180
189VALUE rb_reg_alloc(void);
190
199VALUE rb_reg_init_str(VALUE re, VALUE s, int options);
200
218
232
240int rb_reg_options(VALUE re);
241
243
244#endif /* RBIMPL_INTERN_RE_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
Defines RBIMPL_ATTR_NONNULL.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
int rb_reg_backref_number(VALUE match, VALUE backref)
Queries the index of the given named capture.
Definition re.c:1288
int rb_reg_options(VALUE re)
Queries the options of the passed regular expression.
Definition re.c:4371
VALUE rb_reg_last_match(VALUE md)
This just returns the argument, stringified.
Definition re.c:1993
VALUE rb_reg_match(VALUE re, VALUE str)
This is the match operator.
Definition re.c:3863
void rb_match_busy(VALUE md)
Asserts that the given MatchData is "occupied".
Definition re.c:1534
VALUE rb_reg_nth_match(int n, VALUE md)
Queries the nth captured substring.
Definition re.c:1969
VALUE rb_reg_match_post(VALUE md)
The portion of the original string after the given match.
Definition re.c:2048
VALUE rb_reg_nth_defined(int n, VALUE md)
Identical to rb_reg_nth_match(), except it just returns Boolean.
Definition re.c:1953
VALUE rb_reg_match_pre(VALUE md)
The portion of the original string before the given match.
Definition re.c:2017
VALUE rb_reg_new_str(VALUE src, int opts)
Identical to rb_reg_new(), except it takes the expression in Ruby's string instead of C's.
Definition re.c:3494
VALUE rb_reg_match_last(VALUE md)
The portion of the original string that captured at the very last.
Definition re.c:2077
VALUE rb_reg_match2(VALUE re)
Identical to rb_reg_match(), except it matches against rb_lastline_get() (or, the $_).
Definition re.c:3918
VALUE rb_reg_new(const char *src, long len, int opts)
Creates a new Regular expression.
Definition re.c:3555
int len
Length of the buffer.
Definition io.h:8
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40