As LazyOne notes in the comments, URL fragment identifiers ("hash tags") are not normally sent to the server in an HTTP request, so they cannot be redirected — or processed in any other way — on the server.
You can rewrite such URLs in JavaScript, if the user's browser supports it and has it enabled. A very basic redirection script could look something like this:
if (window.location == 'http://www.example.com/page.html#foobar') {
window.location = 'http://www.example.com/other.html#whatever';
}
Documentation for the window.location property can be found e.g. on MDN.
Unfortunately, this trick will generally not work for search engines, which only have very limited (if any) JavaScript support. As toomanyairmiles notes, Google provides a special mechanism for passing so-called "hash-bang" fragment strings to the server.
The way it works is, essentially, that whenever Google's crawler encounters a URL with a fragment string beginning with an exclamation point (!), it rewrites the URL so that the fragment is mapped to a query parameter named _escaped_fragment_ instead. So, for example, the URL:
http://www.example.com/foobar.php#!this-is-a-fragment
would be rewritten by Googlebot into:
http://www.example.com/foobar.php?_escaped_fragment_=this-is-a-fragment
before it sends the request. These query parameters are passed to the server, and so it's possible to process them on the server side, including in rewrite rules. As the FAQ answer quoted by toomanyairmiles says, if you return a normal 200 response or a temporary 302 redirect, Google will normally index the returned page under the original "hash-bang" URL, whereas if you return a 301 permanent redirect, they will index the page under the target URL of the redirect.
Just to be absolutely clear, all this applies only to fragment identifiers starting with an exclamation point. All other fragments are still processed normally (and so not sent to the server) by Google.