in reply to regular expressions on the basis of suffix

If your data is homogeneous, you can use split, if you want, as alternative to regex (use undef to discard the values that are not interesting for you):

my (undef,undef,undef,$val,undef,undef)=split /\s/,"28504 0 abc 148782859 42 101M";

$val have the value that you need in this example

Replies are listed 'Best First'.
Re^2: regular expressions on the basis of suffix
by grizzley (Chaplain) on Jul 23, 2012 at 13:17 UTC

    Or just the number you need:

    my $var = (split /\s/,"28504 0 abc 148782859 42 101M")[3]