import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "(([[:alnum:]][[:punct:]]\\t))*(([ ])*)((.)*)";
final String string = "We are working to set up a meeting with the SAP demo resource to:\n"
+ "1. See the demo beforehand\n"
+ "2. Ask some questions the client is interested in\n"
+ "a. How is the returned document routed, and can this be defined?\n"
+ "b. Can status of the returned document trigger notifications/field updates?\n"
+ "3. Answer Questions I have\n"
+ "a. Can signers be assigned logically, i.e. like an Agreement template, or only manually?\n"
+ "b. Can cc’s be automatically assigned?\n"
+ "c. The screen shots show different categories of signers Internal/External. Does this affect functionality, or is it just for data collection?\n"
+ "d. What alternative authentication types are supported?\n"
+ "e. Is Document Cloud copy automatically deleted?\n"
+ "f. The screen shots don’t show the ability to send comments. Is this possible?\n"
+ "g. Can you define completion deadlines during sending?\n"
+ "h. Do you have the ability to turn on “Preview & Add Signature Fields”?\n"
+ "i. It is unclear in the screen shots if sending multiple documents is possible.";
final String subst = "\\5";
final Pattern pattern = Pattern.compile(regex);
final Matcher matcher = pattern.matcher(string);
// The substituted value will be contained in the result variable
final String result = matcher.replaceAll(subst);
System.out.println("Substitution result: " + result);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html