use regular expressions rather than touching String.prototype

this is probably faster too, since it doesn't create a bunch of new strings, though I don't have any measurements since the example in the development folder doesn't seem complete.