x = "output/file.zip" x =~ /output\/.\../
返回nil。转义句点有点问题,但我不能弄清楚。
发布于 2011-02-19 03:46:16
在正则表达式中,.通常表示“任何字符”。试试.*,意思是".重复了0次或更多次“:
.
.*
x =~ /output\/.*\..*/
对我来说很好。
https://stackoverflow.com/questions/5045803
相似问题