Ruby: include/ruby/re.h Source File

Ruby 4.0.6p0 (2026-07-14 revision 03b6d3f8898a28604fe6cb00eae3226b821168f4)

re.h
Go to the documentation of this file.
1#ifndef RUBY_RE_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RUBY_RE_H 1
13#include "ruby/internal/config.h"
14
15#ifdef HAVE_SYS_TYPES_H
16# include <sys/types.h>
17#endif
18
19#include <stdio.h>
20
21#include "ruby/onigmo.h"
22#include "ruby/regex.h"
23#include "ruby/internal/core/rmatch.h"
24#include "ruby/internal/dllexport.h"
25
26struct re_registers; /* Defined in onigmo.h */
27
28 RBIMPL_SYMBOL_EXPORT_BEGIN()
29
30
37 VALUE rb_reg_regcomp(VALUE str);
38
62long rb_reg_search(VALUE re, VALUE str, long pos, int dir);
63
82 VALUE rb_reg_regsub(VALUE repl, VALUE src, struct re_registers *regs, VALUE rexp);
83
97long rb_reg_adjust_startpos(VALUE re, VALUE str, long pos, int dir);
98
106 VALUE rb_reg_quote(VALUE str);
107
127regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
128
149OnigPosition rb_reg_onig_match(VALUE re, VALUE str,
150 OnigPosition (*match)(regex_t *reg, VALUE str, struct re_registers *regs, void *args),
151 void *args, struct re_registers *regs);
152
168int rb_reg_region_copy(struct re_registers *dst, const struct re_registers *src);
169
170 RBIMPL_SYMBOL_EXPORT_END()
171
172#endif /* RUBY_RE_H */
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
rb_reg_search
long rb_reg_search(VALUE re, VALUE str, long pos, int dir)
Runs the passed regular expression over the passed string.
Definition re.c:1861
rb_reg_prepare_re
regex_t * rb_reg_prepare_re(VALUE re, VALUE str)
Exercises various checks and preprocesses so that the given regular expression can be applied to the ...
Definition re.c:1632
rb_reg_adjust_startpos
long rb_reg_adjust_startpos(VALUE re, VALUE str, long pos, int dir)
Tell us if this is a wrong idea, but it seems this function has no usage at all.
Definition re.c:1736
rb_reg_onig_match
OnigPosition rb_reg_onig_match(VALUE re, VALUE str, OnigPosition(*match)(regex_t *reg, VALUE str, struct re_registers *regs, void *args), void *args, struct re_registers *regs)
Runs a regular expression match using function match.
Definition re.c:1700
rb_reg_regcomp
VALUE rb_reg_regcomp(VALUE str)
Creates a new instance of rb_cRegexp.
Definition re.c:3499
rb_reg_quote
VALUE rb_reg_quote(VALUE str)
Escapes any characters that would have special meaning in a regular expression.
Definition re.c:4103
rb_reg_regsub
VALUE rb_reg_regsub(VALUE repl, VALUE src, struct re_registers *regs, VALUE rexp)
Substitution.
Definition re.c:4467
rb_reg_region_copy
int rb_reg_region_copy(struct re_registers *dst, const struct re_registers *src)
Duplicates a match data.
Definition re.c:980
rmatch.h
Defines struct RMatch.
re_registers
Definition onigmo.h:717
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40