1. Write a regular expression that will match strings that are either all lower case or all upper case. Assume that the string is a single word that is at least two letters long and consists only of letters. For example, it will match AM, PM, am or parrot but NOT match Am, aM, Pm or Parrot.
2. Write a substitution command that will change names like file1, file2, etc. to file01, file02, etc. but will not add a zero to names like file10 or file20.
3.Many news and mail readers automatically highlight URLs that appear in text, for example http://yahoo.com or www.msnbc.com. Construct a regular expression that will extract the names of URLs embedded in a string.
4. Write a function that takes times of the form 03:12:19 (in other words, three hours, twelve minutes, and nineteen seconds) and converts them to the corresponding number of seconds.
小弟在这里多谢大家帮忙!