Regex Practice Problems Solutions

Regex Practice Problems Solutions - CNT 4714 Enterprise...

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

View Full Document Right Arrow Icon
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 [email protected] HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cnt4714/spr2011
Background image of page 1

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

View Full DocumentRight Arrow Icon
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.
Background image of page 2
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})$/
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online