This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Document existing reginclass behavior
authorKarl Williamson <public@khwilliamson.com>
Sun, 31 Oct 2010 15:11:39 +0000 (09:11 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 31 Oct 2010 21:49:11 +0000 (14:49 -0700)
regexec.c

index 842afaf..cd7f74e 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -6181,10 +6181,16 @@ Perl_regclass_swash(pTHX_ const regexp *prog, register const regnode* node, bool
  - reginclass - determine if a character falls into a character class
  
   The n is the ANYOF regnode, the p is the target string, lenp
-  is pointer to the maximum length of how far to go in the p
+  is pointer to the maximum number of bytes of how far to go in the p
   (if the lenp is zero, UTF8SKIP(p) is used),
   utf8_target tells whether the target string is in UTF-8.
 
+  Returns true if matched; false otherwise.  For utf8 strings, if lenp is not
+  NULL, on return from a successful match, the value it points to will be
+  updated to how many bytes in p were matched.  The value is undefined,
+  possibly changed from the input if there was no match.
+  For non-utf8 strings, *lenp is unchanged.
+
  */
 
 STATIC bool