Regex Practice Problems Solutions

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

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

View Full Document Right Arrow Icon
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 markl@cs.ucf.edu HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cis4004/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
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.
Background image of page 2
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})$/
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.

This note was uploaded on 07/04/2011 for the course CIS 4004 taught by Professor Staff during the Spring '11 term at University of Central Florida.

Page1 / 16

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

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