Tuesday, February 2, 2016

Everything I learned about linux in the last, I don't know 64 hours? 1454425611

I try to make these things 24 hours, but I'm relocating to another state, and goodbyes had to be said. And packing and then thins that have to do with that and whatever. Anyways, let's talk about Regex:

I love regex. I once regexed a regex to prove a point. I don't know why but this sort of pattern matching is a puzzle I enjoy. Regex is one of the few things I like helping out with. Regex Crossword is one of my favorite things. I use them more than I should and it probably gets me in trouble. Notably there are many reasons you shouldn't use regex. As JWZ said (sort of but not really):

Some people, when confronted with a problem, think
“I know, I'll use regular expressions.”   Now they have two problems.


One problem in particular is parsing xhtml. This particular stack overflow post about it is hilarious.

Another problem with regex is performance, particularly in the case of "catastrophic backtracking". That occurs, usually when you have multiple groupings, and there isn't a match. Because of the order of operations of the regex, it becomes computationally expensive.

If you want to know more about catastrophic backtracking, and preventing it with atomic grouping,   regular-expressions.info has a good write up. The regex buddy tool is an excellent way to debug regexes as well.

LibrePlanet in March will have Edward Snowden as a guest.


There is an upcoming Hack the Left hackathon. Hackathon's are getting interesting as there may now be pro hackathoners

I don't have a one liner or regex of the day today, sorry.

No comments: