/* file name is endno1.c */ * should*/ int i; 10002 /*should not*/ int j; /*should not*/ int k; /* should*/ int m; 20002 #### int i; int j; /* 10th line = 20 */ int k; /*should*/ int m; 20005 #### find . -name "*.c" -exec cat {} \; |perl -ne 'print $1\n" if $_ =~ /(.*)\d+$/' #### /*should*/ int m; 2000 /* should*/ int i; 1000 /* should*/ int m; 2000 #### find . -name "*.c" -exec cat {} \; |perl -ne 'print $1\n" if $_ =~ /(.*)(.*?(?=\d))$/' #### /* 10th line = 2 */