r1404@localhost: muntyan | 2005-12-17 12:01:38 -0600

egg_regex_get_string_number()
master
Yevgen Muntyan 2005-12-18 00:04:12 +00:00
parent 194b12e352
commit 8599078b23
2 changed files with 15 additions and 2 deletions

View File

@ -443,8 +443,7 @@ egg_regex_fetch_pos (EggRegex *regex,
{
/* make sure the sub expression number they're requesting is less than
* the total number of sub expressions that were matched. */
if (match_num >= regex->matches)
return;
g_return_if_fail (match_num < regex->matches);
if (start_pos)
*start_pos = regex->offsets[2 * match_num];
@ -1366,3 +1365,13 @@ egg_regex_escape (const char *string,
return escaped;
}
int
egg_regex_get_string_number (EggRegex *regex,
const char *name)
{
g_return_val_if_fail (regex != NULL, PCRE_ERROR_NULL);
g_return_val_if_fail (name != NULL, PCRE_ERROR_NULL);
return _pcre_get_stringnumber (regex->regex, name);
}

View File

@ -166,6 +166,10 @@ gchar *egg_regex_replace_eval (EggRegex *regex,
gpointer user_data,
EggRegexMatchFlags match_options);
int egg_regex_get_string_number (EggRegex *regex,
const char *name);
gchar *egg_regex_eval_replacement (EggRegex *regex,
const gchar *string,
const gchar *replacement,