about summary refs log tree commit homepage
path: root/lib/PublicInbox/MsgIter.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/MsgIter.pm')
-rw-r--r--lib/PublicInbox/MsgIter.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/PublicInbox/MsgIter.pm b/lib/PublicInbox/MsgIter.pm
index 6c18d2bf..fa25564a 100644
--- a/lib/PublicInbox/MsgIter.pm
+++ b/lib/PublicInbox/MsgIter.pm
@@ -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;