{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Regex Practice Problems Solutions

# Regex Practice Problems Solutions - CIS 4004 Web-Based...

This preview shows pages 1–5. Sign up to view the full content.

CIS 4004: Regex Practice Problem Solutions Page 1 Dr. Mark Llewellyn © CIS 4004: Web-Based Information Technology Spring 2011 Regular Expression Practice Problem SOLUTIONS Department of Electrical Engineering and Computer Science University of Central Florida Instructor : Dr. Mark Llewellyn [email protected] HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cis4004/spr2011

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CIS 4004: Regex Practice Problem Solutions Page 2 Dr. Mark Llewellyn © Practice Problems Here are a few regular expression practice problems. You might try to construct regular expressions for these in both POSIX and PCRE formats. I’ll post the solutions in a day or so. 1. Credit card numbers in the format 9999-9999-9999-9999 2. Zip codes in either 5 digit or 9 digit formats, e.g., 99999 or 99999-9999 3. Phone numbers in the format (area code) prefix – number. 4. Social security numbers.
CIS 4004: Regex Practice Problem Solutions Page 3 Dr. Mark Llewellyn © Practice Problem SOLUTIONS 1. Credit card numbers in the format 9999-9999-9999-9999 POSIX format: /^[[:digit:]]{4}(-[[:digit:]]{4})\$/ PCRE format: /^\d{4}(-\d{4})\$/

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CIS 4004:
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern