2007-04-30 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols:
+ * glib/gregex.[hc]: Add g_regex_get_max_backref() and
+ g_regex_get_capture_count(). (#419371, Marco Barisione)
+
+2007-04-30 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/glib.symbols:
* glib/gregex.[hc]: Split GRegex into GRegex and GMatchInfo.
(#419368, Marco Barisione)
2007-04-30 Matthias Clasen <mclasen@redhat.com>
+ * glib/glib-sections.txt: Add new regex functions
+
+2007-04-30 Matthias Clasen <mclasen@redhat.com>
+
* glib/glib-sections.txt:
* glib/tmpl/gregex.sgml: Update for the GRegex/GMatchInfo
split.
g_regex_new
g_regex_free
g_regex_get_pattern
+g_regex_get_max_backref
+g_regex_get_capture_count
g_regex_get_string_number
g_regex_escape_string
g_regex_match_simple
g_regex_new
g_regex_free
g_regex_get_pattern
+g_regex_get_max_backref
+g_regex_get_capture_count
g_regex_get_string_number
g_regex_escape_string
g_regex_match_simple
}
/**
+ * g_regex_get_max_backref:
+ * @regex: a #GRegex
+ *
+ * Returns the number of the highest back reference
+ * in the pattern, or 0 if the pattern does not contain
+ * back references.
+ *
+ * Returns: the number of the highest back reference.
+ *
+ * Since: 2.14
+ */
+gint
+g_regex_get_max_backref (const GRegex *regex)
+{
+ gint value;
+
+ pcre_fullinfo (regex->pcre_re, regex->extra,
+ PCRE_INFO_BACKREFMAX, &value);
+
+ return value;
+}
+
+/**
+ * g_regex_get_capture_count:
+ * @regex: a #GRegex
+ *
+ * Returns the number of capturing subpatterns in the pattern.
+ *
+ * Returns: the number of capturing subpatterns.
+ *
+ * Since: 2.14
+ */
+gint
+g_regex_get_capture_count (const GRegex *regex)
+{
+ gint value;
+
+ pcre_fullinfo (regex->pcre_re, regex->extra,
+ PCRE_INFO_CAPTURECOUNT, &value);
+
+ return value;
+}
+
+/**
* g_regex_match_simple:
* @pattern: the regular expression
* @string: the string to scan for matches
GError **error);
void g_regex_free (GRegex *regex);
const gchar *g_regex_get_pattern (const GRegex *regex);
+gint g_regex_get_max_backref (const GRegex *regex);
+gint g_regex_get_capture_count (const GRegex *regex);
gint g_regex_get_string_number (const GRegex *regex,
const gchar *name);
gchar *g_regex_escape_string (const gchar *string,