Regular expressions will backtrack. That's an unfortunate thing about them because backtracking can be slow. And in certain (rare) cases the performance can become so awful that executing the regular expression against a relatively short string could take over a minute. There's a good article about catastrophic backtracking over at regular-expressions.info . And today I created a video about all of this called Regex Lesson 5: Optimization . In the video I start with a very poorly written regular expression and make several improvements to it, using the benchmarking feature along the way. By the end of the video I make the regular expression over 3 million times faster. In addition, today's update to Regex Hero provides a little message in the event that you encounter a regular expression that takes over 10 seconds to evaluate... And then last of all, I changed the benchmarking feature a bit. In the past it would simply test your regular expression against
I love this tool and come to it as my default regex editor every time I need to work something through with a little help. I even bought a copy for a friend, it's that good!
ReplyDeleteHave you consider open-sourcing it? Perhaps it might live for much longer if others contribute to keeping it alive.
Thanks!
Thank you Rik. And yes I have thought about open-sourcing it. However, a successful open-source project requires a very active maintainer. And without that the software could actually devolve. So it's something I'd have to balance very carefully should I ever do it. At the moment I'm still OK with dedicating time to it myself as needed.
ReplyDeleteI think it would be great if you open sourced this. Even if you just approved PRs, the product could move forward and people could help you add features and such. Great tool, I'm a huge fan.
ReplyDelete