solution

i) Write the string literal regular expression that will match the following String. Use the String.matches() method to verify your answer. String string1 = “I want a bicycle.”; ii) Write a regular expression that will match “I want a bike.” and “I want a ball.” Verify your answer by using the matches() method. String string2 = “I want a bicycle.”: String string3 = “I want a ball.”; iii) Replace all occurrences of blank with an underscore for the following string. Print out the resulting string. String string4 = “Replace all blanks with underscores.”; iv) Write a regular expression that will match the following string in its entirety. Use the String.matches() method to verify your answer. String string5 = “aaabcccccccdddefffg”: v) Write a regular expression that will only match the string5 above in its entirety,
 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp