This is unlikely to work with standard networking software and regexes, since SQL Server uses binary protocol Tabular Data Stream (TDS).
You would probably need a specialized application using something like FreeTDS or jTDS to decode, modify, forward, and respond to the requests.
If security is your concern, there are several commercial products offering database firewall features. For example, Audit Vault and Database Firewall from Oracle (yes it works with SQL Server too) or Database Firewall from GreenSQL.
From an architecture perspective, if this is a brand new application being envisioned, you may want to look at not exposing the SQL server directly but handling this kind of logic at the web service layer.
EDIT: it's possible to have SQL Server use HTTP endpoints (SOAP) for specific items, but this feature is deprecated and was removed in SQL 2012, so you should not count on it as a well-supported feature. Their recommendation is to handle this at the web service layer using WCF.