---
title: "Common uses for Regex parsing"
url: "https://osherove.com/blog/2003/4/6/common-uses-for-regex-parsing.md"
canonical: "https://osherove.com/blog/2003/4/6/common-uses-for-regex-parsing.html"
published: "2003-04-06T03:04:00"
updated: "2003-04-06T03:04:00"
tags: []
author: "Roy Osherove"
description: "Got this in my email today... Here are some nice examples of of parsing using Regex for some commonly used cases * IsValidEmail - Validating an E-mail Address http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75356…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Common uses for Regex parsing

By Roy Osherove April 6, 2003

**Historical article** · Originally published April 6, 2003; technical details may be outdated.

**Got this in my email today...**

**Here are some nice examples of of parsing using Regex for some commonly used cases**

\* IsValidEmail - Validating an E-mail Address [http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75356](http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75356)

\* IsValidUrl - Validating a URL [http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75357](http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75357)

\* IsValidUsPhoneNumber - Validating a US Phone Number [http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75358](http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75358)

\* IsValidUsZip - Validating a US ZIP Code [http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75359](http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75359)

\* IsValidUsSSN - Validating a US Social Security Number (SSN) [http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75360](http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75360)

\* IsValidPath - Validating a System Path [http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75361](http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75361)

\* IsValidIP - Validating an IP Address [http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75362](http://archive.devx.com/devxpress/gurl.asp?i=1X2694710X75362)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
