Posted By

egreg1968 on 08/23/08


Tagged

regex textmate ruby


Versions (?)

Apache regex


 / Published in: Other
 

  1. regex = /^(pms(?!/attachments).*)$/
  2. patterns = ["pms", "pms/attachments", "pms/asdf", "pms/attachments/stuff.txt", "pms/asdf/werqw.txt"]
  3. patterns.each do |p|
  4. matches = p.match(regex)
  5. if matches
  6. puts "? = [#{matches}]"
  7. end
  8. end
  9. nil
  10.  

Report this snippet  

You need to login to post a comment.