Well, for one, I've been using Apache for around 10 years now. So I learned through time just how things were done. Like the .htpasswd file took me around 4 months to grasp (my brother showed me how eventually).
As for what I wrote, it's just simple RegEx. If you google for RegEx or Regular Expressions, a slew of sites will pop up. It's a typical syntax. It's also explained in the Apache manual for .htaccess files.
Other than searching on Google for RegEx (because who knows what delivery of info will work for you) and the above links to by Roger, there's really no other places to learn about what can go into a .htaccess file.