in reply to Help with regex, how to get the largest integer in a string?
On each line, grab all non-zero integers, sort, return the highest.
print +(sort {$b <=> $a} grep /^\d+$/, split)[0] while <>;
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|