GRegex: update documentation for partial matching
authorSébastien Wilmet <swilmet@gnome.org>
Fri, 12 Jul 2013 14:44:13 +0000 (16:44 +0200)
committerSébastien Wilmet <swilmet@gnome.org>
Sat, 20 Jul 2013 09:07:46 +0000 (11:07 +0200)
The restrictions on partial matching no longer apply with PCRE >= 8.00.

The pcrepartial manpage contains the "FORMERLY RESTRICTED PATTERNS"
section:

"For  releases  of PCRE prior to 8.00, because of the way certain
internal optimizations were implemented in the pcre_exec() function, the
PCRE_PARTIAL option (predecessor of PCRE_PARTIAL_SOFT) could not be used
with all patterns. From release 8.00 onwards, the restrictions no
longer  apply,  and  partial  matching  with  can  be requested for any
pattern."

https://bugzilla.gnome.org/show_bug.cgi?id=704250

glib/gregex.c

index 1ae8e0a..fa3a18f 100644 (file)
@@ -874,19 +874,11 @@ g_match_info_get_match_count (const GMatchInfo *match_info)
  * stops at the partial match.
  * When both #G_REGEX_MATCH_PARTIAL_SOFT and #G_REGEX_MATCH_PARTIAL_HARD
  * are set, the latter takes precedence.
- * See <ulink>man:pcrepartial</ulink> for more information on partial matching.
  *
- * Because of the way certain internal optimizations are implemented
- * the partial matching algorithm cannot be used with all patterns.
- * So repeated single characters such as "a{2,4}" and repeated single
- * meta-sequences such as "\d+" are not permitted if the maximum number
- * of occurrences is greater than one. Optional items such as "\d?"
- * (where the maximum is one) are permitted. Quantifiers with any values
- * are permitted after parentheses, so the invalid examples above can be
- * coded thus "(a){2,4}" and "(\d)+". If #G_REGEX_MATCH_PARTIAL or 
- * #G_REGEX_MATCH_PARTIAL_HARD is set
- * for a pattern that does not conform to the restrictions, matching
- * functions return an error.
+ * There were formerly some restrictions on the pattern for partial matching.
+ * The restrictions no longer apply.
+ *
+ * See <ulink>man:pcrepartial</ulink> for more information on partial matching.
  *
  * Returns: %TRUE if the match was partial, %FALSE otherwise
  *