]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MsgIter.pm
quiet "Complex regular subexpression recursion limit" warnings
[public-inbox.git] / lib / PublicInbox / MsgIter.pm
index 6c18d2bf3102c56e070d8a1ff8dbce44b47e847d..fa25564a5db1042f6623ae838270920414fd12f2 100644 (file)
@@ -71,4 +71,14 @@ sub msg_part_text ($$) {
        ($s, $err);
 }
 
+# returns an array of quoted or unquoted sections
+sub split_quotes {
+       # Quiet "Complex regular subexpression recursion limit" warning
+       # in case an inconsiderate sender quotes 32K of text at once.
+       # The warning from Perl is harmless for us since our callers can
+       # tolerate less-than-ideal matches which work within Perl limits.
+       no warnings 'regexp';
+       split(/((?:^>[^\n]*\n)+)/sm, shift);
+}
+
 1;