I'm not sure this can work. The #
is something that is usually interpreted only by browsers.
The browser doesn't actually send this character to the webserver (unless encoded) so your rule won't ever match.
This was the log line I saw when trying:
127.0.0.1 - - [15/Apr/2014] "GET /?title=foobar HTTP/1.1" 200 466 "-"
Note that the #9
is missing from the request altogether.