![](/img/trans.png)
[英]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.