I have a set of regex replacements that are needed to be applied to a set of String,
For example:
(\"\\s{
You have these 2 replaceAll calls:
replaceAll
s = s.replaceAll("\\s{2,}"," "); s = s.replaceAll("\\.([a-zA-Z])",". $1");
You can combine them into a single replaceAll like this:
s = s.replaceAll("\\s{2,}|(\\.)(?=[a-zA-Z])", "$1 ");
RegEx Demo