[Chicago-talk] Using a hash in a regex

Andy Lester andy at petdance.com
Thu Jul 13 15:05:33 PDT 2006


On Jul 13, 2006, at 5:01 PM, Jay Strauss wrote:

> Duh... I'm officially stupid.  What is the advantage of index() to
> regex?

Some people will point out that it's faster (or worse, "more  
efficient") but that's infintessimal.

The key is that if you're not using the regex metacharacters, they  
can't screw you up.

What if you have a category called "Income in $US"?  If you match  
that as /$str/, then you're matching /Income in $US/, and that will  
never match because "$" means "end of line."

xoa

--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance






More information about the Chicago-talk mailing list