fork download
  1. s="!!!??"
  2. matches = s.scan(/(([?!])\2*)/).inject([]) { |acc, (m, _)| acc << m }
  3. puts matches
Success #stdin #stdout 0.01s 5792KB
stdin
Standard input is empty
stdout
!!!
??