【发布时间】:2013-02-01 14:02:47
【问题描述】:
给出这个特定正则表达式背后想法的原始问题是Regex to find content not in quotes。
让我们稍微修改一下原始示例:
INSERT INTO Notifify (to_email, msg, date_log, from_email, ip_from)
VALUES
(
:to_email,
'test teste nonono',
:22,
:3mail,
:ip_from
)
我知道任何编程语言都不允许以数字开头的变量,但这并不意味着我们不能有需要匹配 :to_email 或 :3mail 和 :ip_from 而不是 @ 987654327@.
我们如何进行?我和我的朋友尝试过(理论上)这种方式->
- 将所有字符串存储在一个集合中
- 减去仅包含数字的集合
对于在线测试,我使用的是RegExr。
【问题讨论】:
标签: regex string-matching