in reply to Simple regex related problem

tr as an alternative to length.

$ perl -E ' > $str = qq{\t\t\tcol1\tcol2}; > $str =~ m{^(\t+)}; > $leadingTabs = $1 =~ tr{\t}{}; > say $leadingTabs;' 3 $

Cheers,

JohnGG