fork download
  1. MY_SEPARATOR_TOKENS = ["-", " to "]
  2. s = "M14-19"
  3. puts s.split(/^(m|f)(?=\d+[[:space:]]*#{Regexp.union(MY_SEPARATOR_TOKENS)})/i).drop(1)
  4. #=> ["M", "14-19"]
Success #stdin #stdout 0s 28688KB
stdin
Standard input is empty
stdout
M
14-19