Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 6th, 2012  |  syntax: None  |  size: 0.15 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. simple ruby reg ex for matching only one of three single characters
  2. [1] pry(main)> "a" =~ /^[a-c]$/
  3. => 0
  4. [2] pry(main)> "ac" =~ /^[a-c]$/
  5. => nil