puts "100 red balloons\n50th red balloon".gsub(/(\d+(?:th|[rn]d|st))|[^a-z\s]/i, "\\1")
Standard input is empty
red balloons 50th red balloon
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!