Lines Matching refs:regex
166 GRegex *regex; /* the regex */ member
842 match_info_new (const GRegex *regex, in match_info_new() argument
858 match_info->regex = g_regex_ref ((GRegex *)regex); in match_info_new()
876 pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_CAPTURECOUNT, in match_info_new()
887 match_info->regex->pcre_re, in match_info_new()
909 return match_info->regex; in g_match_info_get_regex()
963 g_regex_unref (match_info->regex); in g_match_info_unref()
1031 opts = map_to_pcre2_match_flags (match_info->regex->match_opts | match_info->match_opts); in g_match_info_next()
1032 match_info->matches = pcre2_match (match_info->regex->pcre_re, in g_match_info_next()
1044 match_info->regex->pattern, match_error (match_info->matches)); in g_match_info_next()
1072 match_info->pos = NEXT_CHAR (match_info->regex, in g_match_info_next()
1385 if (!(match_info->regex->compile_opts & PCRE2_DUPNAMES)) in get_matched_substring_number()
1386 return pcre2_substring_number_from_name (match_info->regex->pcre_re, (PCRE2_SPTR)name); in get_matched_substring_number()
1389 entrysize = pcre2_substring_nametable_scan (match_info->regex->pcre_re, in get_matched_substring_number()
1534 G_DEFINE_QUARK (g-regex-error-quark, g_regex_error)
1547 g_regex_ref (GRegex *regex) in g_regex_ref() argument
1549 g_return_val_if_fail (regex != NULL, NULL); in g_regex_ref()
1550 g_atomic_int_inc (®ex->ref_count); in g_regex_ref()
1551 return regex; in g_regex_ref()
1564 g_regex_unref (GRegex *regex) in g_regex_unref() argument
1566 g_return_if_fail (regex != NULL); in g_regex_unref()
1568 if (g_atomic_int_dec_and_test (®ex->ref_count)) in g_regex_unref()
1570 g_free (regex->pattern); in g_regex_unref()
1571 if (regex->pcre_re != NULL) in g_regex_unref()
1572 pcre2_code_free (regex->pcre_re); in g_regex_unref()
1573 g_free (regex); in g_regex_unref()
1607 GRegex *regex; in g_regex_new() local
1642 regex = g_new0 (GRegex, 1); in g_regex_new()
1643 regex->ref_count = 1; in g_regex_new()
1644 regex->pattern = g_strdup (pattern); in g_regex_new()
1645 regex->pcre_re = re; in g_regex_new()
1646 regex->compile_opts = compile_options; in g_regex_new()
1647 regex->match_opts = match_options; in g_regex_new()
1649 return regex; in g_regex_new()
1760 g_regex_get_pattern (const GRegex *regex) in g_regex_get_pattern() argument
1762 g_return_val_if_fail (regex != NULL, NULL); in g_regex_get_pattern()
1764 return regex->pattern; in g_regex_get_pattern()
1780 g_regex_get_max_backref (const GRegex *regex) in g_regex_get_max_backref() argument
1784 pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_BACKREFMAX, &value); in g_regex_get_max_backref()
1800 g_regex_get_capture_count (const GRegex *regex) in g_regex_get_capture_count() argument
1804 pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_CAPTURECOUNT, &value); in g_regex_get_capture_count()
1820 g_regex_get_has_cr_or_lf (const GRegex *regex) in g_regex_get_has_cr_or_lf() argument
1824 pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_HASCRORLF, &value); in g_regex_get_has_cr_or_lf()
1842 g_regex_get_max_lookbehind (const GRegex *regex) in g_regex_get_max_lookbehind() argument
1846 pcre2_pattern_info (regex->pcre_re, PCRE2_INFO_MAXLOOKBEHIND, in g_regex_get_max_lookbehind()
1867 g_regex_get_compile_flags (const GRegex *regex) in g_regex_get_compile_flags() argument
1869 g_return_val_if_fail (regex != NULL, 0); in g_regex_get_compile_flags()
1871 return map_to_pcre1_compile_flags (regex->compile_opts); in g_regex_get_compile_flags()
1885 g_regex_get_match_flags (const GRegex *regex) in g_regex_get_match_flags() argument
1887 g_return_val_if_fail (regex != NULL, 0); in g_regex_get_match_flags()
1889 return map_to_pcre1_match_flags (regex->match_opts & G_REGEX_MATCH_MASK); in g_regex_get_match_flags()
1920 GRegex *regex; in g_regex_match_simple() local
1926 regex = g_regex_new (pattern, compile_options, 0, NULL); in g_regex_match_simple()
1927 if (!regex) in g_regex_match_simple()
1929 result = g_regex_match_full (regex, string, -1, 0, match_options, NULL, NULL); in g_regex_match_simple()
1930 g_regex_unref (regex); in g_regex_match_simple()
1988 g_regex_match (const GRegex *regex, in g_regex_match() argument
1995 return g_regex_match_full (regex, string, -1, 0, match_options, in g_regex_match()
2067 g_regex_match_full (const GRegex *regex, in g_regex_match_full() argument
2080 g_return_val_if_fail (regex != NULL, FALSE); in g_regex_match_full()
2086 info = match_info_new (regex, string, string_len, start_position, in g_regex_match_full()
2125 g_regex_match_all (const GRegex *regex, in g_regex_match_all() argument
2132 return g_regex_match_all_full (regex, string, -1, 0, match_options, in g_regex_match_all()
2191 g_regex_match_all_full (const GRegex *regex, in g_regex_match_all_full() argument
2208 g_return_val_if_fail (regex != NULL, FALSE); in g_regex_match_all_full()
2221 pcre_re = regex_compile (regex->pattern, in g_regex_match_all_full()
2222 regex->compile_opts | PCRE2_NO_AUTO_POSSESS, in g_regex_match_all_full()
2229 pcre_re = regex->pcre_re; in g_regex_match_all_full()
2232 info = match_info_new (regex, string, string_len, start_position, in g_regex_match_all_full()
2276 regex->pattern, match_error (info->matches)); in g_regex_match_all_full()
2309 g_regex_get_string_number (const GRegex *regex, in g_regex_get_string_number() argument
2314 g_return_val_if_fail (regex != NULL, -1); in g_regex_get_string_number()
2317 num = pcre2_substring_number_from_name (regex->pcre_re, (PCRE2_SPTR)name); in g_regex_get_string_number()
2370 GRegex *regex; in g_regex_split_simple() local
2376 regex = g_regex_new (pattern, compile_options, 0, NULL); in g_regex_split_simple()
2377 if (!regex) in g_regex_split_simple()
2380 result = g_regex_split_full (regex, string, -1, 0, match_options, 0, NULL); in g_regex_split_simple()
2381 g_regex_unref (regex); in g_regex_split_simple()
2415 g_regex_split (const GRegex *regex, in g_regex_split() argument
2421 return g_regex_split_full (regex, string, -1, 0, in g_regex_split()
2464 g_regex_split_full (const GRegex *regex, in g_regex_split_full() argument
2487 g_return_val_if_fail (regex != NULL, NULL); in g_regex_split_full()
2516 match_ok = g_regex_match_full (regex, string, string_len, start_position, in g_regex_split_full()
2573 match_info->pos = PREV_CHAR (regex, &string[match_info->pos]) - string; in g_regex_split_full()
2593 last_separator_end = PREV_CHAR (regex, &string[last_separator_end]) - string; in g_regex_split_full()
3099 g_regex_replace (const GRegex *regex, in g_regex_replace() argument
3113 g_return_val_if_fail (regex != NULL, NULL); in g_regex_replace()
3127 result = g_regex_replace_eval (regex, in g_regex_replace()
3174 g_regex_replace_literal (const GRegex *regex, in g_regex_replace_literal() argument
3187 return g_regex_replace_eval (regex, in g_regex_replace_literal()
3257 g_regex_replace_eval (const GRegex *regex, in g_regex_replace_eval() argument
3274 g_return_val_if_fail (regex != NULL, NULL); in g_regex_replace_eval()
3286 g_regex_match_full (regex, string, string_len, start_position, in g_regex_replace_eval()