Detect quoted text in emails I have small dataset (<10k) of emails (plaintext) that need to be classified. Currently I'm doing research on topic of email preprocessing and I can't find any suitable solution for quoted text detection. There's plenty of answered similar question on StackOverflow (example question), but they all agree on rule-based solutions (regex). But I have rather diverse dataset with no specific delimeter between main and quoted parts. So I want to know, is there any other solution/research apart from regex?
 A: In a comment you clarify that the primary task is email classification and removing quoted text is meant to "make my classifier perform better".
I suspect that you are making an assumption: that you think classification would be easier without quoted text rather than you have evidence that quoted text introduces noise and errors into the classification process. You don't describe what the classification task is (aside: the more details you include, the more on-point answers you get) but I guess that quoted text may provide useful context for the topic of the email. I wouldn't start working on methods to remove this context until I understand better that quoted text is an issue and why.
So I suggest you follow the outlines of @Tim's advice and build end-to-end classifier first. See how the baseline performs without removing quoted text and do some error analysis to determine what are the most common reasons for the baseline classifier to get it wrong. Work on fixing those common sources of error. Iterate.
Error analysis is the process of looking at misclassified examples to understand why the classifier got it wrong. It's a manual but very efficient procedure for discovering the most common sources of error. Working on those is the best way to improve the performance of an ML model. See Andrew Ng's Machine Learning Yearning book.
Finally, there might be a middle ground between coming up with a system of regex rules and developing a machine learning solution to remove quoted text in emails: email parsing. A quick search came up with  mail-parser, a python library for parsing email structure, though it may not be applicable in your use case.
A: How many possible delimiters could there be? I guess that you can detect the vast majority of them with a rule-based system. You should build a rule-based system at least as a benchmark. Such a system would be easy to build, so you would have something that works pretty fast. While building it, you would have a chance to do an exploratory analysis of your data, which would be useful if you decide to build something based on machine learning next (what preprocessing is needed, what are the problems with the data, some strange edge cases). Once you have it, you can start working on a machine learning solution. Given the benchmark, you would know how good or bad the performance of the model is and if the performance improvements are worth the time spend on it. The reason you see so many answers suggesting rule-based solutions is that in most cases they are enough for the problem.
Moreover, if you have a dataset with less than 10k emails, it probably would not be enough to train a machine learning model that would be more sophisticated and much better performant than the rule-based system. Especially, it won't be able to learn the unorthodox delimiters, because for this you would need many examples per each such delimiter. So if you want to use machine learning, you probably would need to gather more data first.
