Javascript String scan(pattern, iterator)
String.prototype.scan = function(pattern, iterator) { this.gsub(pattern, iterator);/*from w w w . j a va 2 s . c o m*/ return String(this); };