T
TechStu
I need help writing regular expressions for the following problems:-
1. date has the following format: month day, year
month is a name of the month,
day represents a day and may contain one or two digits,
y represents a year and contains 4 digits.
Your solution (regular expression) should match, for example, the
following:
July 4, 2004
September 16,1987
December 3, 2001
However, your solution (regular expression) should not match, for
example, the
following:
Dec 3, 2001
February 30, 2002
2. file name has the following format:
disk-drive:\directory-name\...\directory-name\name.extension
disk-drive is a letter that indicates a disk drive
directory-name represents a directory name that starts with a letter
and contains letters,
digits, or '_' characters. The maximum size of directory-name is 16.
name represents a file name that starts with a letter and contains
letters, digits, or '_'
characters. The maximum size of name is 16.
extension represents a file type. The following file types should be
considered: exe, pdf,
doc, xls, txt.
Your solution (regular expression) should match, for example, the
following:
search1.exe
c
aper.pdf
c:\paper.pdf
a:\class\cs763\fall_2004\syllabus.doc
However, your solution (regular expression) should not match, for
example, the
following:
c
aper.xxx
Thanks!
1. date has the following format: month day, year
month is a name of the month,
day represents a day and may contain one or two digits,
y represents a year and contains 4 digits.
Your solution (regular expression) should match, for example, the
following:
July 4, 2004
September 16,1987
December 3, 2001
However, your solution (regular expression) should not match, for
example, the
following:
Dec 3, 2001
February 30, 2002
2. file name has the following format:
disk-drive:\directory-name\...\directory-name\name.extension
disk-drive is a letter that indicates a disk drive
directory-name represents a directory name that starts with a letter
and contains letters,
digits, or '_' characters. The maximum size of directory-name is 16.
name represents a file name that starts with a letter and contains
letters, digits, or '_'
characters. The maximum size of name is 16.
extension represents a file type. The following file types should be
considered: exe, pdf,
doc, xls, txt.
Your solution (regular expression) should match, for example, the
following:
search1.exe
c
c:\paper.pdf
a:\class\cs763\fall_2004\syllabus.doc
However, your solution (regular expression) should not match, for
example, the
following:
c
Thanks!