or if you really want to do it with a regex:
my ($str1, $str2) = $line =~ /^(.*?)\t(.*)/;
Note that this splits at the first tab. Remove the ? and it will split at the last tab. Note also that the solutions using split actually generate a list with one entry per tab plus one. The regex can only generate a list with two entries. See perlretut.
In reply to Re: String Splitting
by GrandFather
in thread String Splitting
by Bugorr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |