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

c# - IMAP GMAIL getting folder list problem -

PHP proxy to get XML: problem with URL arguments -