📄 api
字号:
Resize group range area of region. normal return: ONIG_NORMAL arguments 1 region: target region 2 n: new size# int onig_name_to_group_numbers(regex_t* reg, const UChar* name, const UChar* name_end, int** num_list) Return the group number list of the name. Named subexp is defined by (?<name>....). normal return: number of groups for the name. (ex. /(?<x>..)(?<x>..)/ ==> 2) name not found: -1 arguments 1 reg: regex object. 2 name: group name. 3 name_end: terminate address of group name. 4 num_list: return list of group number.# int onig_name_to_backref_number(regex_t* reg, const UChar* name, const UChar* name_end, OnigRegion *region) Return the group number corresponding to the named backref (\k<name>). If two or more regions for the groups of the name are effective, the greatest number in it is obtained. normal return: group number. arguments 1 reg: regex object. 2 name: group name. 3 name_end: terminate address of group name. 4 region: search/match result region.# int onig_foreach_name(regex_t* reg, int (*func)(const UChar*, const UChar*, int,int*,regex_t*,void*), void* arg) Iterate function call for all names. normal return: 0 error: func's return value. arguments 1 reg: regex object. 2 func: callback function. func(name, name_end, <number of groups>, <group number's list>, reg, arg); if func does not return 0, then iteration is stopped. 3 arg: argument for func.# int onig_number_of_names(regex_t* reg) Return the number of names defined in the pattern. Multiple definitions of one name is counted as one. arguments 1 reg: regex object.# OnigEncoding onig_get_encoding(regex_t* reg)# OnigOptionType onig_get_options(regex_t* reg)# OnigAmbigType onig_get_ambig_flag(regex_t* reg)# OnigSyntaxType* onig_get_syntax(regex_t* reg) Return a value of the regex object. arguments 1 reg: regex object.# int onig_number_of_captures(regex_t* reg) Return the number of capture group in the pattern. arguments 1 reg: regex object.# int onig_number_of_capture_histories(regex_t* reg) Return the number of capture history defined in the pattern. You can't use capture history if ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY is disabled in the pattern syntax.(disabled in the default syntax) arguments 1 reg: regex object.# OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region) Return the root node of capture history data tree. This value is undefined if matching has faild. arguments 1 region: matching result.# int onig_capture_tree_traverse(OnigRegion* region, int at, int(*func)(int,int,int,int,int,void*), void* arg) Traverse and callback in capture history data tree. normal return: 0 error: callback func's return value. arguments 1 region: match region data. 2 at: callback position. ONIG_TRAVERSE_CALLBACK_AT_FIRST: callback first, then traverse childs. ONIG_TRAVERSE_CALLBACK_AT_LAST: traverse childs first, then callback. ONIG_TRAVERSE_CALLBACK_AT_BOTH: callback first, then traverse childs, and at last callback again. 3 func: callback function. if func does not return 0, then traverse is stopped. int func(int group, int beg, int end, int level, int at, void* arg) group: group number beg: capture start position end: capture end position level: nest level (from 0) at: callback position ONIG_TRAVERSE_CALLBACK_AT_FIRST ONIG_TRAVERSE_CALLBACK_AT_LAST arg: optional callback argument 4 arg; optional callback argument.# UChar* onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, const UChar* s) Return previous character head address. arguments 1 enc: character encoding 2 start: string address 3 s: target address of string# UChar* onigenc_get_left_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s) Return left-adjusted head address of a character. arguments 1 enc: character encoding 2 start: string address 3 s: target address of string# UChar* onigenc_get_right_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s) Return right-adjusted head address of a character. arguments 1 enc: character encoding 2 start: string address 3 s: target address of string# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end)# int onigenc_strlen_null(OnigEncoding enc, const UChar* s) Return number of characters in the string.# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s) Return number of bytes in the string.# int onig_set_default_syntax(OnigSyntaxType* syntax) Set default syntax. arguments 1 syntax: address of pattern syntax definition.# void onig_copy_syntax(OnigSyntaxType* to, OnigSyntaxType* from) Copy syntax. arguments 1 to: destination address. 2 from: source address.# unsigned int onig_get_syntax_op(OnigSyntaxType* syntax)# unsigned int onig_get_syntax_op2(OnigSyntaxType* syntax)# unsigned int onig_get_syntax_behavior(OnigSyntaxType* syntax)# OnigOptionType onig_get_syntax_options(OnigSyntaxType* syntax)# void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op)# void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2)# void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior)# void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options) Get/Set elements of the syntax. arguments 1 syntax: syntax 2 op, op2, behavior, options: value of element.# void onig_copy_encoding(OnigEncoding to, OnigOnigEncoding from) Copy encoding. arguments 1 to: destination address. 2 from: source address.# int onig_set_meta_char(OnigEncoding enc, unsigned int what, OnigCodePoint code) Set a variable meta character to the code point value. Except for an escape character, this meta characters specification is not work, if ONIG_SYN_OP_VARIABLE_META_CHARACTERS is not effective by the syntax. (Build-in syntaxes are not effective.) normal return: ONIG_NORMAL arguments 1 enc: target encoding 2 what: specifies which meta character it is. ONIG_META_CHAR_ESCAPE ONIG_META_CHAR_ANYCHAR ONIG_META_CHAR_ANYTIME ONIG_META_CHAR_ZERO_OR_ONE_TIME ONIG_META_CHAR_ONE_OR_MORE_TIME ONIG_META_CHAR_ANYCHAR_ANYTIME 3 code: meta character or ONIG_INEFFECTIVE_META_CHAR.# OnigAmbigType onig_get_default_ambig_flag() Get default ambig flag.# int onig_set_default_ambig_flag(OnigAmbigType ambig_flag) Set default ambig flag. 1 ambig_flag: ambiguity flag# unsigned int onig_get_match_stack_limit_size(void) Return the maximum number of stack size. (default: 0 == unlimited)# int onig_set_match_stack_limit_size(unsigned int size) Set the maximum number of stack size. (size = 0: unlimited) normal return: ONIG_NORMAL# int onig_end(void) The use of this library is finished. normal return: ONIG_NORMAL It is not allowed to use regex objects which created before onig_end() call.# const char* onig_version(void) Return version string. (ex. "2.2.8")// END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -