HI,
first let me remember that {preg_match} is an enterprise macro, so I suppose you are using this.
Another point is the URL you would like to match. Let me explain.
If you call an URL with an anchor (#) and trace the request to the server, you will see that the anchor part is not sent. This is because it is used only on the client side (browser).
So, you should consider this limit in your "From URL" rule, you will never receive an anchor (#).
Let me know if I didn't understand the question... it's more then possible
Best regards,
Luigi