- 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! - Friday, July 10, 2009 5:25:49 PM by KatieThis is super helpful! Thanks! ^D'd!
- Thursday, July 30, 2009 7:21:14 AM by MartyReally great, thank you. Consider publishing source. It is surely highly appreciated. Regards.
- Friday, July 31, 2009 1:34:22 PM by James ShumakerFantastic site, finally what I needed without all the hassle ;)
- Wednesday, August 05, 2009 9:36:49 AM by Dan OsbornePerfect, thanks!
- Wednesday, August 05, 2009 3:57:08 PM by Jason AbbottI think there may be an issue with the use of AJAX to transmit non-printing characters. If I try to match (the quoted character is 001A or SUB)
Conversion from string "" to type 'Short'
with
\x1A
it fails here. But that same match succeeds in my code. - Thursday, August 06, 2009 11:08:07 PM by InterPatAwesome thanks, very usefull
- Sunday, August 16, 2009 9:58:31 AM by PornoLab.TVHi! The idea of your site is royally
move very good <a href=http://www.pornolab.tv> hardcore TV tube</a>.
thanx - Sunday, August 23, 2009 7:54:07 AM by stragerThank you for this! This is a very useful tool.
- Thursday, September 03, 2009 11:59:51 AM by PeterAwesome
- Monday, September 07, 2009 2:28:21 AM by TerrenceI found (the hard way) that if multiple capturing groups are included, only the Groups are displayed in the output. The captures contained within the groups are not shown.
- Monday, September 07, 2009 3:45:24 PM by Stuart DuncanYou might want to remove post number 54! lol
Great tool, btw - Friday, September 11, 2009 2:54:38 AM by s0beitCool, can you add C++ output style as well?
- Thursday, October 01, 2009 4:14:02 PM by RustyNice...best I've found on the web. Very helpful!
- Friday, October 09, 2009 5:33:41 PM by GaryFound a bug. HTML truncates a series of spaces to one
space. Thus the result is displayed incorrectly when spaces are grouped. Consider non-breaking spaces or the 'pre' tag. - Thursday, October 15, 2009 7:27:38 PM by reoveZece<a href=http://pills-no-prescription.com/><img>http://img391.imageshack.us/img391/4641/viagra.jpg</img></a>
<size>15]With <a href=http://pills-no-prescription.com/>VIAGRA</a> you can more...
<a href=http://pills-no-prescription.com/>click and see</a></size>
<a href=http://pills-no-prescription.com/><img>http://img62.imageshack.us/img62/8583/ad1h.gif</img></a> - Monday, October 26, 2009 3:40:37 PM by BrianI especially like how this tool provides all the character escaping for you. I'm generally too lazy to do any such thing myself and really can save some headaches for any super complex expressions... Thanks!
- Wednesday, November 11, 2009 6:56:33 PM by GarySpace bug still exists. Type "123", ten spaces, "ABC" in the Source text box. Then type reg exp "3\x20{10}A" in the Pattern text box. The result only shows one space rather than the 10 spaces. This is because of the HTML feature of truncating spaces to a single space.
- Saturday, November 14, 2009 1:34:58 PM by ForkandBeardThank you for helping to take the sting out of Regex dev.
- Monday, November 23, 2009 11:44:16 PM by JamesThank you. This was very helpful.
- Friday, January 01, 2010 4:15:21 AM by ThanksI used your tool to test my expressions on my site called http://alcoheimers.com
- Wednesday, January 06, 2010 5:08:13 PM by EvanI've had this bookmarked for over a year now, using it consistently. Thanks!
- Wednesday, January 13, 2010 1:25:45 PM by Salvatore aka ArtyProgmany thanks for this very useful tool
- Wednesday, January 20, 2010 10:08:45 PM by P-KoSReally nice tool, I found it really helpful, thanks a lot.
- Tuesday, February 02, 2010 7:31:48 PM by Joe VijayM-x regex-builder
- Thursday, February 11, 2010 2:15:43 PM by r3bbA life saver! Thank you very much!
- Monday, February 22, 2010 4:29:38 PM by HarryThank you for your hard work and sharing attitude.
- Wednesday, March 03, 2010 12:33:08 PM by matthiasGood work mate! Thank you...
- Friday, March 05, 2010 9:42:06 AM by ThomasSuper! Uses this all the time...