正则表达式中的斜杠是什么意思?(what do the slash mean in the regex expressions?)
什么是正则表达式“[a-z0-9] \ +”假设是指? 或者具体说这里“\”是什么意思? 这是正确的世界上没有符合该正则表达式的字符串?
What is the regexp "[a-z0-9]\+" suppose to mean? Or specifically what is the "\" suppose to mean here? Is it right the no string in the world that matches that regexp?
最满意答案
\ [a-z0-9]\+的[a-z0-9]\+表示文字加字符。 这是必要的,因为没有斜线, +就是一个或多个量词 。
比较:
[a-z0-9]\+匹配一个拉丁语小写字母或数字,后跟一个加号,例如y+ [a-z0-9]+匹配一个或多个拉丁文小写字母或数字,例如xy4The \ in [a-z0-9]\+ means the literal plus character. It's needed because without the slash, the + would be a one-or-more quantifier.
Compare:
[a-z0-9]\+ matches a Latin lower-case letter or number followed by a plus, e.g. y+ [a-z0-9]+ matches one or more Latin lower-case letter or numbers, e.g. xy4更多推荐
发布评论