I hope this isn't flippant, but have you read the Perl regex man pages [0]? "Perl compatible" regexes are very common, and are explained _really_ well. Similarly, the Perl Cookbook (from O'Reilly) has a whole chapter on regular expressions -- even crazy ones like detecting US phone numbers (hard!) -- with explanations. That chapter is QUITE good, and I highly recommend it even you don't write Perl.
For your specific problem at hand, I assume you want to replace spaces with a tab character.
In Perl, you could do:
# replace four spaces with a tab, globally
$line =~ s/ /\t/g;
You can do this directly on the command line as well:
I have a gist [1] which has very slightly more comments, if you prefer. To paraphrase XKCD, there are now N+1 regex explanations, and I apologize that mine is comparatively worse than all of them. :)