Problem

Figure 8.2b has two if statement conditions that contain what are called regular expressio...

Figure 8.2b has two if statement conditions that contain what are called regular expressions. As indicated these are explained in the Java API Pattern class. This exercise is intended to help you get a better feeling for Java’s regular expressions and their usage. Use your Java API documentation on the Pattern class to get the answers to these questions:

a) What is the meaning of the regular expression, "[A-Z][a-z]*", which appears in Figure 8.2b?


b) What is the regular expression for a character string starting with a ‘Z’ and containing any number of additional characters of any kind except for a space or a tab?


c) What is the regular expression for a string that represents a U.S. long-distance telephone number (three digits, a dash or space, three digits, a dash or space, and four digits)?

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 8
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT