• 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

More from my site

  • BigDump: Alternative to phpMyAdmin to Import/Restore Large DatabaseBigDump: Alternative to phpMyAdmin to Import/Restore Large Database
  • PHP: How to Protect Password in Database – Password HashingPHP: How to Protect Password in Database – Password Hashing
  • PHP: Format integer into number of decimal placesPHP: Format integer into number of decimal places
  • PHP: session_start() – No such file or directory errorPHP: session_start() – No such file or directory error
  • PHP: Short URL Algorithm ImplementationPHP: Short URL Algorithm Implementation
  • Google Adsense Search Result in WorpressGoogle Adsense Search Result in Worpress

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 Reply Cancel reply

Advertisement

  • Facebook
  • Google+
  • Instagram
  • Twitter

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

Adsense advertisement advertising apache blog blogging tips C# EGPC error estimation format format Integer Gmail Google Google Adsense Google Chrome Google Search Engine Google search result how to HTTP internet marketing Java JavaScript Linux money password performance PHP programming search engine optimization secure security short URL SQL static constructor String tiny URL Tips and Tricks twitter video Windows Vista Wordpress wordpress plugin wordpress theme Youtube

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