Ruby: include/ruby/internal/intern/re.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
re.h File Reference

Public APIs related to rb_cRegexp. More...

`#include "ruby/internal/dllexport.h"`
`#include "ruby/internal/value.h"`

Go to the source code of this file.

## Macros
#define | rb_memcmp memcmp
#define | HAVE_RB_REG_NEW_STR 1

## Functions
int | rb_memcicmp (const void *, const void *, long)
void | rb_match_busy (VALUE)
VALUE | rb_reg_nth_defined (int, VALUE)
VALUE | rb_reg_nth_match (int, VALUE)
int | rb_reg_backref_number (VALUE match, VALUE backref)
VALUE | rb_reg_last_match (VALUE)
VALUE | rb_reg_match_pre (VALUE)
VALUE | rb_reg_match_post (VALUE)
VALUE | rb_reg_match_last (VALUE)
VALUE | rb_reg_new_str (VALUE, int)
VALUE | rb_reg_new (const char *, long, int)
VALUE | rb_reg_alloc (void)
VALUE | rb_reg_init_str (VALUE re, VALUE s, int options)
VALUE | rb_reg_match (VALUE, VALUE)
VALUE | rb_reg_match2 (VALUE)
int | rb_reg_options (VALUE)

## Detailed Description

Public APIs related to rb_cRegexp.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Warning
  Symbols prefixed with either `RBIMPL` or `rbimpl` are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.

Note
  To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance `__VA_ARGS__` is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file re.h.

## Macro Definition Documentation

## ◆ HAVE_RB_REG_NEW_STR

#define HAVE_RB_REG_NEW_STR 1

Definition at line 39 of file re.h.

## ◆ rb_memcmp

#define rb_memcmp memcmp

Definition at line 29 of file re.h.

## Function Documentation

## ◆ rb_match_busy()

void rb_match_busy | ( | VALUE | match | ) |

Definition at line 1305 of file re.c.

References FL_SET, match, and MATCH_BUSY.

Referenced by date__httpdate(), date__iso8601(), date__jisx0301(), date__parse(), date__rfc2822(), date__rfc3339(), and date__xmlschema().

## ◆ rb_memcicmp()

int rb_memcicmp | ( | const void * | x,
|  | const void * | y,
|  | long | len
| ) |  |

Definition at line 88 of file re.c.

References len.

Referenced by rb_num_get_rounding_option().

## ◆ rb_reg_alloc()

VALUE rb_reg_alloc | ( | void |  | ) |

Definition at line 2900 of file re.c.

References rb_cRegexp.

Referenced by rb_enc_reg_new(), rb_reg_compile(), and rb_reg_new_str().

## ◆ rb_reg_backref_number()

int rb_reg_backref_number | ( | VALUE | match,
|  | VALUE | backref
| ) |  |

Definition at line 1191 of file re.c.

References match.

## ◆ rb_reg_init_str()

VALUE rb_reg_init_str | ( | VALUE | re,
|  | VALUE | s,
|  | int | options
| ) |  |

Definition at line 2912 of file re.c.

References err, and NULL.

Referenced by rb_reg_new_str().

## ◆ rb_reg_last_match()

VALUE rb_reg_last_match | ( | VALUE | match | ) |

Definition at line 1750 of file re.c.

References match, and rb_reg_nth_match().

## ◆ rb_reg_match()

VALUE rb_reg_match | ( | VALUE | re,
|  | VALUE | str
| ) |  |

Definition at line 3194 of file re.c.

References LONG2FIX, NULL, Qnil, rb_str_sublen(), and str.

Referenced by Init_Regexp().

## ◆ rb_reg_match2()

VALUE rb_reg_match2 | ( | VALUE | re | ) |

Definition at line 3253 of file re.c.

References LONG2FIX, Qnil, rb_backref_set(), rb_lastline_get(), rb_reg_search(), rb_str_sublen(), and T_STRING.

Referenced by Init_Regexp().

## ◆ rb_reg_match_last()

VALUE rb_reg_match_last | ( | VALUE | match | ) |

Definition at line 1811 of file re.c.

References BEG, match, NIL_P, re_registers::num_regs, Qnil, and rb_reg_nth_match().

## ◆ rb_reg_match_post()

VALUE rb_reg_match_post | ( | VALUE | match | ) |

Definition at line 1794 of file re.c.

References BEG, END, match, NIL_P, Qnil, rb_str_subseq(), RMATCH, RSTRING_LEN, and str.

Referenced by Init_Regexp().

## ◆ rb_reg_match_pre()

VALUE rb_reg_match_pre | ( | VALUE | match | ) |

Definition at line 1768 of file re.c.

References BEG, match, NIL_P, Qnil, rb_str_subseq(), RMATCH, and str.

Referenced by Init_Regexp().

## ◆ rb_reg_new()

VALUE rb_reg_new | ( | const char * | s,
|  | long | len,
|  | int | options
| ) |  |

Definition at line 2960 of file re.c.

References len, rb_ascii8bit_encoding(), and rb_enc_reg_new().

## ◆ rb_reg_new_str()

VALUE rb_reg_new_str | ( | VALUE | s,
|  | int | options
| ) |  |

Definition at line 2906 of file re.c.

References rb_reg_alloc(), and rb_reg_init_str().

Referenced by rb_reg_new_ary(), and rb_reg_regcomp().

## ◆ rb_reg_nth_defined()

VALUE rb_reg_nth_defined | ( | int | nth,
|  | VALUE | match
| ) |  |

Definition at line 1707 of file re.c.

References BEG, match, NIL_P, re_registers::num_regs, Qfalse, Qnil, and Qtrue.

## ◆ rb_reg_nth_match()

VALUE rb_reg_nth_match | ( | int | nth,
|  | VALUE | match
| ) |  |

Definition at line 1725 of file re.c.

References BEG, re_registers::end, END, len, match, NIL_P, re_registers::num_regs, Qnil, rb_str_subseq(), RMATCH, and str.

Referenced by rb_reg_last_match(), and rb_reg_match_last().

## ◆ rb_reg_options()

int rb_reg_options | ( | VALUE | re | ) |

Definition at line 3593 of file re.c.

References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, ARG_REG_OPTION_MASK, KCODE_FIXED, RBASIC, REG_ENCODING_NONE, and RREGEXP_PTR.