Description
For example, given a line
num 123 num 2345 num 84210 num 1357
what we want is
2345 1357
Be careful, your RE may not only give you the two expected numbers, but also give you '84210' which contains '8421' and '4210'!
Script and Comments
Script1 [perl]
[ 1] foreach $i (m/(?<!\d)\d{4}(?!\d)/g);
[ 2] { print "$i "; }
[ 3] print "\n";
Raw Input
num 123 num 2345 num 84210 num 1357
Desired Output
2345 1357