Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Goal: To complete some methods that utilise simple regular expressions to process and validate different string formats. Please see Lecture 4 , slides 4 3
Goal: To complete some methods that utilise simple regular expressions to process and
validate different string formats. Please see Lecture slides for details on regular
expressions regex
Please refer to the API for laband the comments within the Questionjava file for
more information on the operation of each method and hints
There are two methods to complete for this question.
In the first, we will use a regex expression and a suitable replacebased method from the
String class to match and replace all digits in an input string text with the corresponding
String mask both provided as arguments to the method. The result should be the new
version of the string, which should be returned from the method.
public String replaceAllNumbersString text, String mask
Examples:
replaceAllNumbers## # #
replaceAllNumbersI am years old", "I am years old"
replaceAllNumbersI live at Main St
"I live at Main St
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started