Re:Another common bug in published code
by silvestrov on Friday April 22, 2011 @02:31PM
(#2474951)
There's an uncommon bug in the regexp in the link: sequence count metacharacters such as * are postfix, not prefix. (please ignore whitespace in following regexps as the YA markup requires whitespace to avoid making text italicized).
parseInt\(* [^,]\) means match "parseInt", then 0-or-more '(', then a character that is not a comma, then ')'.
parseInt\(* [^,]\) means match "parseInt", then 0-or-more '(', then a character that is not a comma, then ')'.
The regexp should be something like parseInt\([^,()]* \) which returns code where the argument is more than a single character http://www.google.com/codesearch?hl=en&lr=&q=parseIn...