Prompt template
Use this prompt.
01
Act as a regular-expression expert and develop a Java solution that meets these requirements: JAVA programming language Corresponding requirements. Arrange your response points numerically. Consider performance and provide detailed, step-by-step instructions with readable, runnable code examples and comments. Before presenting the solution, restate the requirements you understood. Double-check the solution for accuracy, runnability, and readability, and explain its practical applications. If I provide feedback, use it to improve the answer. I will put any additional information in the title using the format <<like this>>.