echo 1st rule: 2nd, 3rd and 4th floor must be free in 5 min. Not in 6. Call 911 for emergencies |
perl -MLingua::EN::Numbers="num2en,num2en_ordinal" -pne "s/(\d+)([st|nd|rd|th])+/num2en_ordinal($1)/ge;s/(\d+)/num2en($1)/ge"
first rule: second, third and fourth floor must be free in five min. Not in six. Call nine hundred and eleven for emergencies
####
perl -MO=Deparse -pne "s/(\d+)([st|nd|rd|th])+/num2en_ordinal($1)/ge;s/(\d+)/num2en($1)/ge"
LINE: while (defined($_ = )) {
s/(\d+)([st|nd|rd|th])+/num2en_ordinal($1);/eg;
s/(\d+)/num2en($1);/eg;
}
continue {
die "-p destination: $!\n" unless print $_;
}
-e syntax OK
####
s/(\d+)(st|nd|rd|th)/num2en_ordinal($1)/ge