in reply to Simple regex related problem
You don't show us the code you have already written. This makes it hard for us to suggest you ways to improve your code.
You could use the following code, but it's likely even less efficient than a loop:
my $string = "\t\t\tfoo\t\tbar"; $string =~ s/^(\t+).*/$1/; $string =~ s/\t/+1/g; print eval $string, " tabs";
|
|---|