I\'m trying to come up with a regular expression to remove comments from an SQL statement.
This regex almost works:
(/\\*([^*]|[\\r\\n]|(\\*+([^*/]|
Please see my answer here. It works both for line comments and for block comments, even nested block comments. I guess you need to use regex with balancing groups, which AFAIK is not available in VBScript.
For Node.js, see pg-minify library. It works with PostgreSQL, MS-SQL and MySQL scripts.
It can handle all types of comments, plus compress the resulting SQL to its bare minimum, to optimize what needs to be sent to the server.