(a): "This sentence is all over the place, so it's quite hard to overlook all of these spelling problems!"
Exercises
Regular expressions
-
Fix the following sentences (you can chain multiple regular expressions):
"This $entence is AlL oOoooOOoover the place, so its quite hard to overlook al of these spelling problems!"
"Ill call a TaXi 4 u. It will cost around 4 dollars."
"This sentence contains too man y s p a c e s."
Expected output:
(b): "I'll call a taxi for you. It will cost around 4 dollars."
(c): "This sentence contains too many spaces."
-
Write a regular expression that would match all of the words in the following array:
"All", "Tall", "Ball"
"map", "amp", "LAMP", "Ape"
Expected output:
(a): TRUE, TRUE, TRUE
(b): TRUE, TRUE, TRUE, TRUE