Translate

Friday, January 25, 2013

Regular Expression Tester

I "regularly"  (nyuk nyuk!) use regular expressions in my .Net code.  However, I find that I spend no small amount of time designing them, troubleshooting why they aren't working and trying to work out the escape characters correctly.  So much so that I decided to write a Regex testing application.

Regex Tester (zipped .exe)

C# Source Code

This tool allows me to rapidly test regular expressions against sample text with or without options.


It shows me matches, splits and replaced text.

If the Regex phrase is invalid, it will display the error text:



When I'm satisfied with the phrase and options, I click Copy Regex Initializer to copy it to the clipboard:


I can paste the copied text directly into my code after declaring the Regex object:

I hope you find it useful.


2 comments:

kevinthenerd said...

Nice!

I write a lot of REGEX'es in Oracle Database. I'm spoiled by the direct execution by the database because testing is just a matter of opening a SQL editor...

SELECT REGEXP_REPLACE('ORDER_NO=foo^LINE_NO=bar^', '^[A-Z_]*=([^^]*)\^[A-Z_]*=([^^]*)\^$', '\1 \2') FROM DUAL;

7pgp9ltcqx said...

For the fans of progressive Jackpot, Jackpot City can provide Roulette Royale, one of the groundbreaking variations of the sport. Regardless of what particular rules you like, Roulette gaming options are endless, ultimately making Jackpot City a paradise for the actual Roulette lovers. Still, hit one of many many progressive jackpots on provide at the on line casino and that play-through 파라오카지노 requirement will imply nothing. Real-money gamers are offered 100% back on their first 4 deposits a lot as} a most of $400 per deposit. The on line casino prides itself on 'super quick cashouts', with most withdrawals promised inside 48 hours.