From 8f2275b596097f93f21c4dad8db6c51b58210a90 Mon Sep 17 00:00:00 2001 From: Andy Klimczak Date: Sun, 20 Aug 2017 19:07:31 -0400 Subject: [PATCH] Simplify regex for removing post no when quoting with text --- .../java/org/floens/chan/core/presenter/ReplyPresenter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java b/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java index 0259e4de..3c5e529f 100644 --- a/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java +++ b/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java @@ -280,7 +280,7 @@ public class ReplyPresenter implements ReplyManager.HttpCallback, if (withText) { String[] lines = post.comment.toString().split("\n+"); - final Pattern quotePattern = Pattern.compile("^>>\\d+(\\s\\(OP\\))?$"); // matches for >>123 or >>123 (OP) + final Pattern quotePattern = Pattern.compile("^>>(>/[a-z0-9]+/)?\\d+.*$"); // matches for >>123, >>123 (OP), >>123 (You), >>>/fit/123 for (String line : lines) { if(!quotePattern.matcher(line).matches()) { // do not include post no from quoted post textToInsert += ">" + line + "\n";