Skip to main content


Showing posts from 2009

Tab Multiple Lines

Well I didn't expect to get this done so fast, but I did. You can now tab or untab multiple lines of text inside Regex Hero by hitting tab and shift+tab on your keyboard. It works pretty much the same way as it does in Visual Studio. Here's a video demonstration: I didn't make this very clear in the video, but the size of the tab seems to be outside of my control. I'm hoping to find a way to fix this when I upgrade to Silverlight 3 or 4.

Faster than 94% of sites

I've always taken performance seriously so this statistic was pretty cool to learn about. Google has added a new section to their Webmaster Tools called "Site Performance." The stats here are gathered by users who have the Google toolbar. And here's what they have to say about : Performance overview On average, pages in your site take 0.7 seconds to load (updated on Dec 9, 2009). This is faster than 94% of sites. The chart below shows how your site's average page load time has changed over the last few months. For your reference, it also shows the 20th percentile value across all sites, separating slow and fast load times. Not bad. The funny thing is that I know there's still room for improvement. The blog actually has a lot of elements in it from blogger that all add to the latency time. At some point I'll be switching to something like Umbraco or Orchard and I should be able to improve this.

100 License Giveaway Is Over: Thank You Early Adopters

Since I wasn't prepared to make the switch in an automated fashion, I actually gave free licenses to 105 people in total. So if you're one of those 105 who signed up for an account already you should now see a license key in your account . This whole giveaway was a way to reward the early adopters of Regex Hero that were with me from the beginning. Thanks guys! I spent this weekend making final touches to the ordering process. I chose to go with PayPal only for now. Of course it'll allow you to pay with your PayPal account. Or if you don't have a PayPal account, you can simply enter your credit card information. It works pretty nicely. The side benefit is that PayPal works well with international orders as well. And in fact only 38% of website traffic to Regex Hero comes from the U.S., so accepting orders from other countries is important. Regex Hero is not entirely free anymore, but I still want it to be a good deal. So I've set the price at $15 and t

Yahoo Login Problem Resolved (Thank you DotNetOpenAuth)

Apparently Yahoo made a breaking change to their OpenID provider system which conflicts with the DotNetOpenAuth release I was using. Fortunately the guys maintaining the DotNetOpenAuth project were all over it and just released an emergency fix in version 3.3.1 . After I learned this, all I did is upload the dll from this latest version and that fixed the problem. So if you were previously unable to login with your Yahoo OpenID, you should be able to now .

Still Growing

I've blogged before about the growth of the site . And I guess I'm doing it again. After all, I'm pretty excited about it. So here it is again, this time from April through November. All Visitors Returning Visitors Once again the trend of ever-increasing returning visitors continues. That's pretty cool.

Exciting Things to Come: My To Do List

I still have a lot planned for Regex Hero so I thought I'd take the opportunity to share it all. Display Match Groups (Completed) This was an idea by controlgeek that I plan to implement. Soon Regex Hero will optionally display the matched text from all groups (if any) as well as their corresponding group names. Technically this is easy to do but I just have to plan the UI carefully. Tab Support (Completed) I've made a number of customizations to the textboxes in Regex Hero already. But one thing that still bugs me is the way tabs work inside the textboxes. Whenever you hit tab, it skips to the next textbox. So you can't easily type a tab into a textbox. So I plan to fix that, and while I'm at it I want to find a way to tab multiple lines simultaneously. This is a feature common to most text editors nowadays so it's about time I catch up. Regular Expression Highlighting (Completed) I want to add some simple highlighting to the regular expressions

Giving Away the First 100 User Licenses

UPDATE: Thank you everyone for participating. I've given away 105 licenses. Read more . So I'm getting ready to sell Regex Hero. It will be priced at $15 per user license. But before I do, I'm giving away the first 100 copies for free. I figure the easiest way to handle this is to give away copies to the first 100 users who create an account on the site. If you haven't already done so, you can create an account now to ensure you get your free copy. As a registered user you'll also gain the ability to save & open your own regular expressions in the Regex Hero database. As I'm writing this, there are 12 users already signed up. Most of the applications I've created over the years I've simply given away for free. So it is a new and unfamiliar experience to sell Regex Hero. It is so different that I wasn't comfortable to completely deny people the ability to use it for free. So in fact even after it goes on sale Regex Hero will have a

Reference and More

I took the time this weekend to update the syntax reference with the remaining sections that were still missing. I still need to create a lot more examples, but at least the syntax with descriptions are complete. I then grabbed that completed reference and added it to Regex Hero : Initially my plan was to create a static modal dialog box with the reference in it. But a fellow user of Regex Hero suggested doing it this way so a thanks goes to him. I think it works quite well. To save myself time I actually used Regex Hero to parse the reference. I separated each regular expression from the description by grouping which then allowed me to build my XAML much faster. It's kind of ironic using Regex Hero to build Regex Hero but if it speeds up redundant tasks then I'm all for it. In fact, I've used Regex Hero a lot lately to help me with redundant code. I'll try to make a video example of that some day soon. While I was doing all of this I also refactored a

Regex Hero Embraces MVC, OpenID, and Cloud Computing

You may have noticed that there haven't been any updates for awhile. Well, I've been working on this update for the past three weekends. It was a big one. First, I completely rewrote the site from scratch. I went from ASP.NET Web Forms in VB.NET to ASP.NET MVC in C#. I did it for the learning experience, but I also did it because I wanted the added control that MVC gives me. I like the fact that I was finally able to rid the site of all viewstate information. And I also like the way that URL's and forms are handled in MVC . Second, I built an OpenID login/registration system. I believe OpenID is finally at the point now where it's easy enough to use, and you don't even have to completely understand how OpenID works to use it. In the past registration forms asked you for your OpenID URL which of course most people don't know. But now you can simply click a logo to log in. You can log in here to see what I mean. I used the excellent DotNetOpenID

Step Through Regex Matches

This feature has been on my list of "must haves" for awhile. It's simple, but very useful at times. I've added a couple buttons that allow you to step through your regex matches... As you see here the text highlighted in orange represents the currently selected match. Be sure to give it a try .

Improving Perceived Performance

Ah yes, perceived performance: it can be such an underrated thing. I thought Regex Hero was still loading a little slow for a ~50KB application. In fact I looked at this a couple months ago and found that my initialization code was preventing the Regex Hero UI from appearing until it was done. As such, you'd actually be looking at a blank screen a little longer than you should. When talking about perceived performance, a blank screen like this is just about the worst user experience possible because in the back of the user's mind they might be thinking, "Did this application just hang?" Even if they don't think that, any kind of prolonged stillness can be perceived as slowness and that's the last thing I want. So at the time I tried a few things to correct this but couldn't find a good solution that worked well and didn't cause any other problems. Today I took another crack at it and finally solved the problem. You'll notice now that wh

The Permalink Feature

I made several changes yesterday. You'll notice that I've changed the layout a bit, moving "Generate .NET Code", "Benchmark", and now "Permalink" under Tools. Permalink is new. I've seen it plenty of times in blogs and forums and such. But the idea with Regex Hero is that it'll actually save the state of Regex Hero into a database, generate a GUID, and then return a permanent link. There's an example of that here: The motivation for this comes from all the questions about writing regular expressions I see all the time. These questions are asked all over the place but lately it's looking like StackOverflow is the most popular place to ask. This permalink feature could prove useful to the person asking the question, or even the person answering it. That way it becomes that much easier to see the regular expression in question and what regex options are r

Optimizing a Silverlight XAP File

I took another hard look at Regex Hero to see if there was any way I could remove the two remaining assemblies I still had in it. I did something similar once before by removing the Linq assembly a couple months ago. But still, the Regex Hero XAP file was 170 KB and I knew these assemblies were taking up most of that. So I tried to find a way to remove the System.Windows.Controls and System.Windows.Controls.Toolkit assemblies. After all, I was using only a small fraction of their features anyway. Well I was indeed able to remove the toolkit by getting rid of the expanders and dockpanels. I found that I didn't really need them. That saved 60 KB. But I still needed the GridSplitter out of the System.Windows.Controls assembly so I wasn't willing to get rid of it. So I asked this question on StackOverflow . It seems that Microsoft released the source for all of Silverlight 2's controls. So I downloaded the source, pulled everything out necessary for the GridSpl

Firefox Bug Fixed

So this was a stupid mistake. After I moved the tester to the "/tester" subdirectory, I removed some of the unnecessary CSS that no longer needed to be applied to the page. I didn't even think to check the site in all of the different browsers again because I hadn't done much. Apparently though I had forgotten something very important... #silverlightControlHost { height: 100%; } I needed to add that little bit of CSS back into the page. Without it Regex Hero was completely invisible to Firefox users. I am sorry about this problem. I wasn't told by anyone that there even was a problem. And I overlooked it because I rarely use Firefox. Anyway, it's solved now. This brings something else to my attention. I'd like to be contacted if there are any problems. But perhaps the GetSatisfaction thing is too much of a hurdle for some people. So I think I'll add a Contact page to the site. That way you can email me directly or use GetSatisfact

Regex Hero Becoming Popular?

Yeah, I guess it's getting there. The site was officially launched April 29th, 2009. Since then it's been blogged, tweeted, digged, dotnetkick-ed,, StackOverflow-ed and made its way around the internet. In that amount of time it's had a total of 3,191 visits, a nice round number. Sorry I couldn't have blogged at more of a landmark type of number. Maybe next time I'll plan that a little better. Below is a graph (thanks to Google Analytics) of total visits from the past few months: And perhaps even more exciting, here's the ever-growing number of returning visitors over that same time period: To me the returning visitors is what it's all about. It just shows that people are indeed returning to use the online tool. Perhaps some people even come here because it has become their Regex testing tool of choice. And that's pretty awesome. To continue this progress I have a lot planned for Regex Hero in the near future. I'll

A Plethora of Updates to the Site and the Tool

First and foremost, you'll notice that I've moved the tool itself to . I've contemplated this move for awhile. On one hand, it was convenient that the home page contained the tool itself. On the other hand, it was a little slow to load for a home page, and a little off-putting for new visitors coming to the site who don't have Silverlight installed. The new home page is much smaller and faster to load to alleviate some of that first-load anxiety. The other difference is that I now have a reference page . This should be handy to pull up in a separate browser while you're using Regex Hero and need a quick regex reference . It's pretty short & sweet right now, but I will be working to improve and expand this page to become a more complete reference. As for the tool itself, I made some more improvements. I've made the auto-saving feature a little more aggressive. I was noticing cases where it wouldn't save. So when you c

Some News and a New Feature

So I'll talk about the feature first. You may have noticed it. It's just a tall gray button along the side of the tool that you can click to collapse & expand the options menu. It can be useful when you're looking for a larger workspace. Plus it's fun to play with. I was motivated to add this because several weeks ago Steve Smith from added Regex Hero to his site. I thought it looked a little cramped for space inside the page layout, so the ability to collapse the options menu has greatly improved this. In other news, Silverlight 3 has been released. There are some cool features that Microsoft has added that will be soon making its way into Regex Hero. The most profound of which will be out-of-browser capabilities. This will mean that soon you'll have the choice to run Regex Hero from the site, or from your desktop.

Improved Auto-Saving

I knew there was room for improvement in the auto-saving feature. So I've made some changes that make the process faster and more efficient. As I talked about last time, the synchronous saving method just had to go. So I made it asynchronous for the 3 main text boxes: regular expressions, replacement string, and the target string. Now that it's asynchronous it doesn't slow you down as you type, even if the target string is quite long. Now, isolated storage does have a limit of 1 MB. So to make good use of space I've imposed a 200,000 character saving limit on these 3 text boxes. Anything beyond that will be truncated. The other change is related to the way I auto-save the settings (checkboxes, expanders, etc). Before I was doing something which was a little bit stupid, as it turns out. I was saving these settings into an XML file in isolated storage. And to do so I had added the System.XML.Linq assembly into Silverlight. Well I found that this was unnecess

Auto-saving Regular Expression and Settings

I think this feature improves the convenience factor of Regex Hero significantly. As you use Regex Hero, your settings and regular expressions will be saved into Silverlight's isolated storage. This works much like a cookie. Next time you visit Regex Hero from the same computer all of your settings and your regular expression will be retained. The only thing I haven't done yet is apply this to the target string. Long target strings were a little too slow to save for my taste. So I'll come up with a better (asynchronous) solution for that later.

Moving from to

Why would anyone in their right mind switch from a nice .com to the less desirable .net domain extension? Well I came up with what I think is a good reason. Since Regex Hero is very specialized towards .NET regular expressions, I thought it'd be good for my search engine placement if I make the switch. Google will put fairly heavy emphasis on the domain itself and even the extension when considering keyword relevance. So if you search for "ASP.NET" you'll find is the first result. Likewise, I'm guessing that eventually my search engine placement for "regex .net" will be quite good. Of course I still own and if you go there you'll be instantly redirected to , so this switch shouldn't cause any broken links.

Animated Highlighting and New Settings

Animated Highlighting Ever since I first created Regex Hero there was one little thing that bothered me. If you made a change in your regular expression that didn't affect the highlighting, then it wasn't obvious that Regex Hero was updating automatically because nothing really changed visually. Well, now the highlighting will actually flash orange and then fade to yellow whenever it's updated. It's a little detail that I think helps provide better feedback to the user. CrLf Setting This is an extension of the work around carriage returns and line feeds I've done recently. The CrLf setting is configurable so Regex Hero will use carriage return/line feed combinations by default, or line feeds only if you wish. Real-time Highlighting Setting 9 times out of 10 I'd think most people would prefer the real-time highlighting that Regex Hero has always had. But in the rare case when you're dealing with massively complex regular expressions and/or target

Carriage Return/Line Feed Bug Fix

Apparently the change I made the other day caused a problem. Replacing carriage returns with line feeds has to be handled a little more carefully. I had forgotten that carriage returns are often paired with line feeds. This is an old Windows (DOS) formatted text standard. So if for example you copied some HTML from a text editor and pasted it into the target string, you'll most likely have both carriage returns and line feeds marking the end of every line. The problem then with what I was doing is that I end up with 2 line feeds for every line. That meant that in this scenario the highlighting for a match was shifted downward. The solution of course was to look for that carriage return/line feed combo first and replace it with a single line feed, and then replace any left over carriage returns after that. This solves the problem and once again makes Regex Hero a dependable tool to use for testing .NET regular expressions.

The Intricacies of Whitespace

A fellow user of the Regex Hero tool pointed out that the multiline option wasn't behaving as expected. In the following scenario with multiline turned on you'd expect every line to be highlighted: Regular expression: ^test$ Target string: test test test Well, as it turns out none of those lines were highlighted and I found out why. Apparently the .NET regex engine looks for the start of new lines based on line feeds rather than carriage returns. So behind the scenes I'm now replacing carriage returns with line feeds within both the regular expression and the target string. This solves the problem and allows multiline mode to behave more like it should. Thank you Ed for letting me know about this. The other little change I've made is concerning trailing whitespace. A co-worker pointed out that it's easy to overlook trailing whitespace in your regular expression. And since most of the time you're not going to purposely put spaces or carriage r

Unlimited Undos & Redos, and a Bug Fix

This was an interesting challenge, but I was able to get multiple undos & redos working in Regex Hero. So now you can press Ctrl+Z (undo) or Ctrl+Y (redo) within the tool, and you'll notice that each textbox has an infinite undo history. It's something I usually take for granted in most applications, but the Silverlight textboxes didn't support it natively so I had to write the functionality myself. It seems to be working pretty well now. While I was at it I also fixed a bug with the RightToLeft option within the tool. Before it would highlight the wrong text most of the time when you had the RightToLeft option turned on, but it's working now. I just had to reverse the order in which I build the highlighted text.

Replacement Strings

I've added the ability to use replacement strings within Regex Hero. Just click the "Replace" tab within the tool and you'll see what I mean. You'll notice that the layout changes when you click the "Match" or "Replace" tabs. I'm guessing that most users will simply want to use the matching functionality that has always been there. So I left "Match" as the default tab when you first bring up the tool.

Regex Error Details

Today I added regex error details to the tool. So now if you write an invalid regular expression, then you can mouse over the little box that pops up to see the complete error details. Hopefully it helps make it easier to figure out what's wrong with the regular expression.

Added number of matches found and fixed a scrolling issue

I added a little text block above the target string that'll show you the number of matches found. So you'll notice that when you first bring it up with Regex Hero highlighted, it simply says, "1 match found." It's such a simple thing, but I thought knowing this number might be useful. The next update is really a partial fix. Apparently there's a problem with the ScrollViewer in Silverlight 2.0 as documented here . Basically, when you try to put something extremely wide in the scroll viewer it'll all go crazy on you hiding and showing its contents sporadically. I fixed the problem by setting a max width on the text box of the target string. Unfortunately this means that the scroll bar won't take you to the very far left or right of extremely wide sections of text. You'll have to use your arrow keys for that. But it's better than what it was doing. Hopefully Silverlight 3.0 will solve this once and for all.

Revised Benchmarking

I noticed something when trying out the benchmarking feature today. It didn't seem to be any slower when matching ten results vs just one. So I knew something was up. After looking into it I still can't fully explain what was happening. Perhaps there was some lazy loading going on, I'm not sure. But I reworked the code today and it seems to scale properly now. It will slow down with more complex regular expressions, as well as target strings with more matches. For those who are curious about how I'm performing the benchmarking now, here's the code: Dim startTime As DateTime = Date.Now Dim _regexBenchmark As New Regex(strRegex, _regexOptions) For i As Integer = 0 To iBenchmarkIterations For Each _match As Match In _regexBenchmark.Matches(strTargetString) If _match.Success Then ' Do nothing End If Next If Benchmarking.CancellationPending Then e.Cancel = True Exit For End If Next e.Result = Date.Now.Subtract(startTime).TotalMilliseconds I'm not s

Regex Hero's Debut

So last week I launched and submitted it to a few social bookmarking sites ( happened to be the most effective). Since then I've had 368 visits to the site. That's a pretty strong start for a brand new website. What Does The Tool Do? Regex Hero will dynamically highlight regular expression matches as you type. The whole idea behind it is to save as much time as possible and make it as convenient as possible to work with regular expressions. What's Special About It? It's the first online .NET regular expression tester with instantaneous highlighting that I know of. (Someone please correct me if I'm wrong.) Microsoft Silverlight lends itself to this functionality perfectly. I essentially wrote it and got it online in 3 days. Since then I've made some tweaks and minor improvements, but nevertheless it was extremely easy to build and I have to thank Microsoft and their development tools for that. The other thing I was sur