[英]Why doesn't this regex match in ruby but matches in any other language?
[英]Why won't this ruby regex match this string?
x = "output/file.zip"
x =~ /output\/.\../
返回零。 逃避这段时间有问题,但我无法弄清楚。
.
通常在正则表达式中表示“任何字符”。 试试.*
,这意味着“重复零次或多次”: .
x =~ /output\/.*\..*/
对我来说很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.