开发者

Regex to determine legal SQL? [duplicate]

开发者 https://www.devze.com 2023-02-25 15:16 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Regular expression to match common SQL syntax?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Regular expression to match common SQL syntax?

I am writing so开发者_开发百科me helpers to help generate some very domain-specific sql. In my test-suite it would be nice to add a sanity check to ensure that the results are actually valid SQL. I'm not doing anything particularly fancy and this isn't production code so I think some regex would do but it's still annoyingly difficult to write by hand.

Is anyone willing to share a regex expression that would validate valid SQL at least for the 90% case?


SQL is not a regular language. Use a real validator, such as Mimer.

See also:

  • Is SQL or even TSQL Turing Complete?
  • Regular expression to match common SQL syntax?
0

精彩评论

暂无评论...
验证码 换一张
取 消