• Home
  • About

Snippet IT

IT News, Programming, Internet and Blogging

  • Programming and Scripting
  • Tips and Tricks
  • Software and Hardware
  • New and Happening
You are here: Home / Programming and Scripting / Regular Expression Test Tool

Regular Expression Test Tool

February 11, 2009 by Sze Hau Leave a Comment

When writing a software, you may need to use regular expression to filter some string values or to validate some input strings. It is quite troublesome to test the correctness of the regular expression pattern that you have designed. You will need to compile you source code, execute the compiled binary, perform some steps until to the point that make use of the regular expression. It takes a lot of time to do the trial and error especially if you are not very familiar with regular expression.

I have wrote a regular expression test tool for my own use and I also uploaded the tool to this web site so that everyone can use it. It is a php page that simply takes two parameters: the regular expression pattern and subject. The two parameters are then passed into a php function called preg_match(). From the returned value:

  • if it is false, then the regular expression pattern is not valid;
  • if it is zero, then the subject does not match the regular expression pattern
  • if it is larger than zero, the subject matches the regular expression pattern

You can find the Regular Expression Test Tool here.

Example of regular expression pattern:

  • Date in yyyy-mm-dd format

Filed Under: Programming and Scripting, Tips and Tricks Tagged With: PHP, preg_match, regular expression

About Sze Hau

Geek. Love programming. Coffee addicted. Married with two children. Working towards financial freedom.

Leave a ReplyCancel reply

Advertisement

Email News Letter

Sign up to receive updates daily and to hear what's going on with us

Software and Hardware

MD5 and SHA1 Checksum Using Windows

July 5, 2017 By Sze Hau Leave a Comment

Blog Network

  • Personal Fincance Personal Finance – Personal Money Tips, Stock Investment, Small Business and Make Money Online
  • szehau's weblog Life, Internet, Software, Gadgets, Programming and Investments

Snippet IT

This is the place where I want to share anything about information technology.

Search

Recent

  • MD5 and SHA1 Checksum Using Windows
  • MD5 and SHA1 Checksum Using Linux
  • Java: Unlimited Strength Jurisdiction Policy
  • WordPress: How To Change Admin Username
  • Linux: How To Compress And Decompress Folders And Files

Tags

advertisement blog C# Chrome DecimalFormat EGPC Float format format Integer free icons Gmail Google Google Adsense Google Chrome Google Search Engine Google search result how to HTTP Java JavaScript Linux money password performance PHP programming search engine optimization secure security short URL site value spam SQL static constructor String thread tiny URL Tips and Tricks trackback twitter video Wordpress wordpress plugin wordpress theme Youtube

Copyright © 2025 · Magazine Pro Theme on Genesis Framework · WordPress · Log in