Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at cf.Objective() 2012 (Minneapolis, MN) with: Aaron Longnion

verdy_p

Member since Dec 28, 2009

Recent Blog Comments By verdy_p

  • Javascript Exec() Method For Regular Expression Matching

    Posted on Dec 28, 2009 at 2:22 AM

    Sorry, replace: for var re = /\t/g, match = re.exec(string); match != null; match = re.exec(match.source)) { ...// use the match[0] substring which maps to match.source at position match.index } by: for (var re = /\t/g, match = re.exec(string); match != null; match = re.exec(match.input)) { ...//... read more »

  • Javascript Exec() Method For Regular Expression Matching

    Posted on Dec 28, 2009 at 1:59 AM

    Note also: if the "g" flag is specified, this is the only case where at most one match will be returned in the non-null array (the loop is then needed) and the regexp object will be modified to hold the lastIndex. In that case also, the returned non-null array (match above) will not just be an array... read more »

  • Javascript Exec() Method For Regular Expression Matching

    Posted on Dec 28, 2009 at 12:59 AM

    NEVER use the code: while (match = /\t/g.exec(string)) { ...// use match[] array... } which effectively can recompile the regexp at each iteration (the /\t/g syntax is considered in IE as the equivalent of instanciating a new Regexp with the string "\\t" and the flag "g", as if you had effectively... read more »