Regular Expressions Lab
Make sure that you're familiar with the Regular Expressions before attempting this challenge. This is a prerequisite to complete the mentioned challenges
- Matching phone numbers in a given format.
If a given String contains a phone number of 10 digits you would have to format the string in the format of
xxx xxx xxxx(with the mentioned spaces)
- Replacing URLs in a text string.
If the given string contains a valid url, return a new string by replacing the valid url with
- Counting the number of words in a text string.
Return the count of the number of words present in the inputted string.
- Removing extra spaces between words in a text string.
If the given string contains any extra spaces between words including traililng and leading spaces. All of them should be removed and return a proper string.
For each challenge, you have to write the code in the desired function from the given boilerplate code.
trim()along with Regular Expressions to complete this lab.