2008/9/22 Kyung won Cheon <kdream95 / gmerce.co.kr>:
>>> "a 1 b".sub(/\b1\b/, "2")
> => "a 2 b"
>>> "a * b".sub(/\b\*\b/, "2")
> => "a * b"                     # Why not "a 2 b" ???
>
>
> How ??

Because neither " *" nor "* " are word boundaries.

Cheers

robert

-- 
use.inject do |as, often| as.you_can - without end