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
In reply to Re: Help with regex, how to get the largest integer in a string?
by QM
in thread Help with regex, how to get the largest integer in a string?
by coltman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |