Regex Practice Problems Solutions

# Regex Practice Problems Solutions - CNT 4714 Enterprise...

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

CNT 4714: Regex Practice Problem Solutions Page 1 Dr. Mark Llewellyn © CNT 4714: Enterprise Computing Spring 2011 Regular Expression Practice Problem SOLUTIONS Department of Electrical Engineering and Computer Science University of Central Florida Instructor : Dr. Mark Llewellyn HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cnt4714/spr2011

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

View Full Document
CNT 4714: 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.
CNT 4714: 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
This is the end of the preview. Sign up to access the rest of the document.
• Spring '10
• LLEWELLYN
• Regular expression, Dr. Mark Llewellyn, Pattern matching, Practice Problem Solutions, Regex Practice Problem

{[ snackBarMessage ]}

### Page1 / 16

Regex Practice Problems Solutions - CNT 4714 Enterprise...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online