my musings 

Facebook Twitter LinkedIn YouTube E-mail RSS
formats

Regular Expressions

I’m by no way a regex expert but if you’re a software engineer that doesn’t know about regular expressions that should definitely be your next skill to add. A great website to start with is regular expression info. For those of you that know all about regular expressions I just wanted to share a nice tool I use with them. If you don’t know about this tool hopefully it helps you.

I’m a big believer in scripting tasks. (Checkout menv to see some of my public scripts to see some of my automation) If you find yourself doing something for a second time, you should consider automating the task as it will probably be well worth your time. Regular expressions help a lot in these automation tasks but like I said I’m still not an expert with them. I know the basics and with a little bit of google I can make one to do just about anything I need. There are a number of online regex debuggers that make the process both easier and more enjoyable. I’m a big fan of regex 101. This allows you to run a regular expression on some sample text and see in real time the matches in that text. My favorite part is the explanation panel which breaks your regular expression down into an English explanation. This is often helpful in figuring out just why your regex isn’t working how you expect. Another website I like is debuggex which gives a more visual representation of the regex. Hopefully you find these helpful. I just finished up using these for some nice perl regexes I needed for some git hooks.

Leave a Reply

Your email address will not be published. Required fields are marked *