![](/img/trans.png)
[英]Regex to not match leading and trailing white spaces for email address in javascript
[英]Javascript regex - how to match when no trailing spaces
在此正则表达式中,我尝试从SQL select语句中提取表列表。 如果该语句以表名结尾,则没有匹配项,但有一个例外,它可以正常工作。 例如:
鉴于他正则表达式:
(?:from|join)\s+(.*?)(?:\)|\s+(?:where|on|inner|outer|full|left|right|join|\s*$))
并给出以下字符串:
"select xxxx from table1 t1, table2, table3 t3 " (note the last space)
匹配为:
"table1 t1, table2, table3 t3"
但鉴于此字符串:
"select xxxx from table1 t1, table2, table3 t3" (without last space)
没有比赛。 如何使这项工作?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.