Advertisement
Guest User

Untitled

a guest
Feb 29th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.33 KB | None | 0 0
  1. #From http://ruby-doc.org/core-1.9.3/Regexp.html
  2.  
  3. /[a-w&&[^c-g]z]/ # ([a-w] AND ([^c-g] OR z))
  4. # This is equivalent to:
  5. /[abh-w]/
  6.  
  7. # but running this via irb gives:
  8. >> /[a-w&&[^c-g]z]/
  9. (irb):60: warning: character class has `[' without escape
  10. (irb):60: warning: regexp has `]' without escape
  11.  
  12. # but seems ok via rubular.com. Why?!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement