- Tuesday, September 11, 2007
A Better .NET Regular Expression Tester
Because the only other online tool I could find for testing .NET regular expressions was slow and covered with ads, I decided to write a simple AJAX regular expression tester. It's certainly not fancy, but it works for me.
Comments
- Tuesday, September 11, 2007 9:04:47 PM by Jim WelchThanks! Nice tool. Maybe you could incorporate some nice ajax callbacks to search regexlib's web service? (http://regexlib.com/WebServices.asmx) Then it'll be nearly perfect. :)
- Tuesday, September 11, 2007 9:16:13 PM by DerekThat's a great idea, Jim -- I'll look into it.
- Wednesday, September 12, 2007 3:07:25 PM by jhunterHave you considered releasing the source for this so someone can create a windows forms version easily?
- Wednesday, September 19, 2007 9:17:20 AM by Fabricejhunter, there are already several Windows Forms tools for testing regular expressions. See http://sharptoolbox.com/categories/regular-expressions
- Thursday, September 27, 2007 8:48:46 PM by bkhvihvbijhbI don't think you can call something "better" without supplying some sort of test results. What is yours better than?
- Thursday, October 04, 2007 5:15:39 PM by Aleksey MalishkinThis is the greatest thing in the world! THANKS!!!!
- Friday, January 25, 2008 2:06:56 PM by Hue HolleranReally useful, Derek - the best around. Could I request one addition, please: could you add the group name to the output please? ie. pattern:@"--\s*\[\s*TABLE\s*\(\s*(?<table>.*?)\s*\)\s*\]", text:"-- [ TaBle ( bob ) ]" - I'd like to see the captured group name - would you consider doing this, please?
- Wednesday, February 06, 2008 1:04:00 PM by Poor RichardWorks great. Just would like to see the results without having to scrool down (at least on my screen).
Thanks. -- Richard - Wednesday, February 06, 2008 1:08:39 PM by Poor RichardOops! My mistake. You just need to scroll down once and it all stays on screen.
Great! -- Rik
PS: Nice if you either underline the matches or made them bold or red. - Thursday, February 21, 2008 9:35:43 PM by LeeKJust perfect Derek - it's bookmarked for me now. Thanks 1,000,000.
- Monday, March 24, 2008 11:49:51 PM by AnonymousHi, great regexp tester, thanks! I was trying to figure out why my matches weren't working, then I realized I was cutting and pasting text from Notepad into the Pattern section which includes a newline. Since my input didn't include a newline, the match failed.
- Wednesday, April 09, 2008 1:04:57 PM by skymultiline and singleline are mutually exclusive. they have nothing to do with how many lines are in the target. multiline off set the eol and bol anchors to match eof and bof. singleline on lets . match all characters including /n
good luck. - Wednesday, April 09, 2008 1:05:32 PM by skyOOPS - meant NOT mutually exclusive
- Monday, May 05, 2008 7:52:48 PM by Yakko WarnerEchoing sky's comment. I actually had a situation that was solved (thanks to a MS MVP in an MSDN forum) by setting both SingleLine *and* MultiLine at the same time. So it does have its purpose.
- Friday, May 30, 2008 10:24:34 AM by Robbeen looking for one of these for ages. Really nice work.
- Friday, June 13, 2008 7:10:24 PM by sahilI was testing with the regex class in .net 2.0 using c# and my regex and source would not give me a match. This tool does give me a match. Any Ideas?
Great tool though, i must add. - Tuesday, July 22, 2008 3:24:27 PM by WalterThanks for this one. Saved my day!
- Sunday, August 03, 2008 5:18:48 PM by Alexander BHThanks for this great tool. I use it all the time! I just wanted to let you know!
- Friday, August 15, 2008 10:33:48 AM by EmmThis helped me a lot! Much appreciated!
- Saturday, August 16, 2008 7:53:54 AM by JamesSuper handy! Thanks very much!
- Wednesday, September 17, 2008 10:03:33 PM by Robert S.Well done!
- Wednesday, November 12, 2008 11:53:20 AM by nyk_is_sykhelped me when mattered. tx god bless u all.
- Tuesday, December 30, 2008 4:29:43 PM by MikeThank You
- Wednesday, December 31, 2008 10:29:57 PM by DanielThis is a great tool, and I really appreciate your taking the time to put it together. I noticed that there seems to be a problem displaying captured groups. Try this pattern:
^((?<entry>[^|]*)\|)*$
with this string:
This is one part.|This is another part.|
This expression correctly captures both parts (I checked), but it displays the two groups as "This is another part.|" and "This is another part." when the captures are actually "This is one part." and "This is another part."
Thanks again. This is an incredibly helpful tool! - Monday, January 12, 2009 5:41:27 PM by MarceloVery useful!
- Friday, January 16, 2009 12:45:08 AM by jeffThank you! I use this a lot.
- Friday, January 16, 2009 1:12:08 PM by MarcoVery useful :)
- Tuesday, January 20, 2009 8:58:01 PM by Matt@Daniel ^
careful with your captures. The normal parenthesis are also captures even though they are not named. - Monday, February 02, 2009 5:43:39 PM by AlanVery useful, thanks.
- Monday, February 02, 2009 6:43:56 PM by JohnGood job; thanks. Have you considered implementing non-greedy options? Or am I mistaken?
- Monday, February 02, 2009 7:39:34 PM by JohnNevermind; my mistake.
- Tuesday, February 03, 2009 4:17:45 PM by BillI love this app. Much nicer than the other online apps I used. Thank you much.
- Thursday, February 05, 2009 9:39:14 AM by Sireesh JindalHey, Is there any limitation in .Net regex on the input string?
I have a 438 line input string, which I have to test against a Regex. But, in VS2005, everything seems to hang when I try to match the string with the Regex. - Wednesday, February 11, 2009 3:35:48 PM by ADovervikIf Visual Studio appears to hang for more than a second or two, you probably want to debug the regexp.
I have tested (in VS2005) to run a fairly complex pattern with 36 capturing groups, and 358 non-capturing used for manging sections of the Regex, against a 300 000 lines text file. A couple of seconds delay, but no hang. - Thursday, February 12, 2009 5:07:01 PM by LarryKThis rocks ... thanks!!
- Tuesday, February 24, 2009 3:52:34 PM by FengIt is wonderful, save time, save life! Thanks a lot!
- Wednesday, February 25, 2009 8:02:05 PM by Jared SaindonFINALLY someone took the time to make a decent online regex tester. Your contribution to the programming world is much appreciated. You are the man!
- Tuesday, March 03, 2009 3:11:16 PM by BryanSAWESOME! Thank you, I've bookmarked this for validating my regex expressions.
- Tuesday, March 17, 2009 2:36:11 PM by MattFantastic tool, thanks!
- Tuesday, March 31, 2009 6:43:39 PM by DigantAwesome tool, use it so often. One thing I'd love to see is named capturing
- Tuesday, April 21, 2009 1:30:53 PM by Rajesh PillaiGood work.
- Thursday, May 07, 2009 12:38:18 PM by KlinkbyI use the tool frequently. May I suggest a final touch? Print out group name for each capture. Thanks again!
- Sunday, May 31, 2009 12:42:54 PM by captchatest
- Saturday, June 06, 2009 6:10:54 PM by caseyfantastic tool I like it much better than the clunky regulator
- Tuesday, June 16, 2009 11:56:59 PM by tertznice tool!
- Thursday, June 18, 2009 12:18:54 PM by Alexander PVery practical tool! Thanks a lot
- Saturday, June 20, 2009 6:47:03 AM by Szczawik.PSqIf I could recommend something: don't show additional quotation marks around matches as they may be confused as a part of a string (or simply show them i.e. in light gray colour).
I usually don't bookmark any pages, but this one is worth it. What a nice and useful tool! Thanks!