/ Published in: Other

Expand |
Embed | Plain Text
regex = /^(pms(?!/attachments).*)$/ patterns = ["pms", "pms/attachments", "pms/asdf", "pms/attachments/stuff.txt", "pms/asdf/werqw.txt"] patterns.each do |p| matches = p.match(regex) if matches puts "? = [#{matches}]" end end nil
You need to login to post a comment.