Ruby: internal/re.h File Reference

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

Functions
re.h File Reference

Internal header for Regexp. More...

`#include "ruby/internal/stdbool.h"`
`#include "ruby/ruby.h"`

Go to the source code of this file.

## Functions
VALUE | rb_reg_compile (VALUE str, int options, const char *sourcefile, int sourceline)
VALUE | rb_reg_check_preprocess (VALUE)
long | rb_reg_search0 (VALUE, VALUE, long, int, int)
VALUE | rb_reg_match_p (VALUE re, VALUE str, long pos)
bool | rb_reg_start_with_p (VALUE re, VALUE str)
void | rb_backref_set_string (VALUE string, long pos, long len)
void | rb_match_unbusy (VALUE)
int | rb_match_count (VALUE match)
int | rb_match_nth_defined (int nth, VALUE match)
VALUE | rb_reg_new_ary (VALUE ary, int options)

## Detailed Description

Internal header for Regexp.

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.

Definition in file re.h.

## Function Documentation

## ◆ rb_backref_set_string()

void rb_backref_set_string | ( | VALUE | string,
|  | long | pos,
|  | long | len
| ) |  |

Definition at line 1358 of file re.c.

References FL_TEST, len, match, MATCH_BUSY, NIL_P, rb_backref_get(), rb_backref_set(), and rb_cMatch.

## ◆ rb_match_count()

int rb_match_count | ( | VALUE | match | ) |

Definition at line 1317 of file re.c.

References match, NIL_P, and re_registers::num_regs.

Referenced by rb_f_global_variables().

## ◆ rb_match_nth_defined()

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

Definition at line 1327 of file re.c.

References BEG, FALSE, match, NIL_P, and re_registers::num_regs.

Referenced by rb_f_global_variables().

## ◆ rb_match_unbusy()

void rb_match_unbusy | ( | VALUE | match | ) |

Definition at line 1311 of file re.c.

References FL_UNSET, match, and MATCH_BUSY.

## ◆ rb_reg_check_preprocess()

VALUE rb_reg_check_preprocess | ( | VALUE | str | ) |

Definition at line 2718 of file re.c.

References err, Qnil, rb_enc_get(), RB_GC_GUARD, RSTRING_LEN, RSTRING_PTR, str, and StringValue.

## ◆ rb_reg_compile()

VALUE rb_reg_compile | ( | VALUE | str,
|  | int | options,
|  | const char * | sourcefile,
|  | int | sourceline
| ) |  |

Definition at line 2966 of file re.c.

References err, FL_SET, Qnil, rb_obj_freeze(), rb_reg_alloc(), rb_set_errinfo(), rb_str_new, REG_LITERAL, and str.

Referenced by rb_parser_reg_compile().

## ◆ rb_reg_match_p()

VALUE rb_reg_match_p | ( | VALUE | re,
|  | VALUE | str,
|  | long | pos
| ) |  |

Definition at line 3353 of file re.c.

References re_registers::beg, re_registers::end, err, len, NIL_P, NULL, NUM2LONG, onig_error_code_to_str(), onig_free(), ONIG_MISMATCH, ONIG_OPTION_NONE, onig_search(), Qfalse, Qtrue, rb_reg_prepare_re0(), rb_str_length(), rb_str_subpos(), rb_sym2str(), RREGEXP, RREGEXP_PTR, RSTRING_LEN, RSTRING_PTR, str, StringValue, SYMBOL_P, and UChar.

## ◆ rb_reg_new_ary()

VALUE rb_reg_new_ary | ( | VALUE | ary,
|  | int | options
| ) |  |

Definition at line 2938 of file re.c.

References rb_obj_freeze(), and rb_reg_new_str().

## ◆ rb_reg_search0()

long rb_reg_search0 | ( | VALUE | re,
|  | VALUE | str,
|  | long | pos,
|  | int | reverse,
|  | int | set_backref_str
| ) |  |

Definition at line 1622 of file re.c.

References NULL, and str.

Referenced by rb_reg_search().

## ◆ rb_reg_start_with_p()

bool rb_reg_start_with_p | ( | VALUE | re,
|  | VALUE | str
| ) |  |

Definition at line 1634 of file re.c.

References err, FL_TEST, len, match, MATCH_BUSY, MEMZERO, NIL_P, onig_error_code_to_str(), onig_free(), onig_match(), ONIG_MISMATCH, ONIG_OPTION_NONE, onig_region_free(), ptr, Qnil, rb_backref_get(), rb_backref_set(), rb_cMatch, rb_memerror(), rb_reg_prepare_re0(), rb_reg_region_copy(), rb_str_new4, RMATCH, RREGEXP, RREGEXP_PTR, RSTRING_GETMEM, str, and UChar.