in reply to Simple regex related problem

By definition, it's impossible to repeat an action (check if the next character is a tab) an arbitrary number of times without using a loop.

Of course, nothing's stopping you from using existing loops.

my $num_leading_tabs = length( (/^(\t*)/)[0] );