in reply to How to extract the 4 number in the filename?

UPDATED: Having been censured for answering an easy question, I'll try going all Perlmonks.

my $FOUR_DIGIT_CAPTURE = qr/ ( # left as an exercise ) /x; while (<DATA>) { if (my ($four_digit_num) = /$FOUR_DIGIT_CAPTURE/) { print # left as an exercise } else { # left as an exercise } } __DATA__ j9999120.125 Be sure to include lots of interesting test cases.

Replies are listed 'Best First'.
Re^2: How to extract the 4 number in the filename?
by padawan_linuxero (Scribe) on Apr 11, 2008 at 22:31 UTC
    thanks ! I need to read the THIS
    and I guess THIS
    I post the anwser I promise
    thanks again for helping me
    :o)
Re^2: How to extract the 4 number in the filename?
by apl (Monsignor) on Apr 11, 2008 at 20:22 UTC
    What happens when the record contains a digit in the first column, rather than a lower-case "J"?

    Let padawan_linuxero read the Regex document...