visual .net正则表达式为sql字符串 [英] visual .net Regex as sql string

查看:128
本文介绍了visual .net正则表达式为sql字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有这样的字符串

[a] =?和[b] =?和[c]> ?或者([d]在[e]和[f] =?)



如何才能获得与此类正则表达式的匹配

1 - [a] =?

2 - [b] =?

3 - [c]> ?

4 - ([d]在[e]和[f] =?)

Hi,

I have string like this
[a] = ? and [b] = ? and [c] > ? or ([d] in [e] and [f] = ?)

how can i get matches with regex like this
1 - [a] = ?
2 - [b] = ?
3 - [c] > ?
4 - ([d] in [e] and [f] = ?)

推荐答案

正则表达式无法嵌套。您需要正确解析文本。但是,正则表达式可用于标记化。

问候

Andi

PS:我假设你有更复杂的表达,例如嵌套(...)的表达式。
Regex can not nest. You need to properly parse the text. Regex can be used to tokenize, though.
Regards
Andi
PS: I assume you have potentially more complex expressions, e.g. expressions with nested (...).


这篇关于visual .net正则表达式为sql字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆