Flagrant Badassery

A JavaScript and regular expression centric blog

Archive for June, 2007

Smoking FAQ, Part 1

Several of my work buddies have quit smoking recently, which means I need to recruit new smokers to join me for smoke breaks. To help with this, here is the first in possibly a series of pro-smoking pieces. (This is adapted from The Easy Way to Start Smoking.) Is smoking cool? Taking even the most […]

Read More

“If you love regexes so much, marry them”

…That's what a buddy of mine (who is in fact more than six years old) told me recently. Here's an equivalent (albeit much more flexible and efficient ) jibe, in regex: (you)?(?(1)\u2665((?:reg(?:ular expressions?|ex(?:p|e[ns])?))++)|(?!))(?>\1\2) This is just an attempt at über-geeky regex humor.

Read More

RegexBuddy 3.0 Beta

RegexBuddy is one of those tools which, now that I've gotten used to having around, I'd have a hard time living without—kind of like regular expressions themselves. I'm happy to see that the recently released (but little publicized) RegexBuddy 3.0 beta pushes what's already the best regex builder/tester on the market quite a bit further. […]

Read More

JavaScript Date Format

Update: The documentation below has been updated for the new Date Format 1.2. Get it now! Although JavaScript provides a bunch of methods for getting and setting parts of a date object, it lacks a simple way to format dates and times according to a user-specified mask. There are a few scripts out there which […]

Read More

Faster JavaScript Trim

Since JavaScript doesn't include a trim method natively, it's included by countless JavaScript libraries – usually as a global function or appended to String.prototype. However, I've never seen an implementation which performs as well as it could, probably because most programmers don't deeply understand or care about regex efficiency issues. After seeing a particularly bad […]

Read More