Why won't this ruby regex match this string? -


x = "output/file.zip"  x =~ /output\/.\../ 

returns nil. there wrong escaping period, can't figure out.

. means "any character" in regex. try .*, means ". repeated 0 or more times":

x =~ /output\/.*\..*/ 

works fine me.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -