in reply to •Re: Re: •Re: Checking for single digit
in thread Checking for single digit
Wouldn't this be more versatile (chomp or no chomp)?
while(defined(my $line = <STDIN>)){ print $1,"\n" if( $line =~ m/\W?(\d)\W?/ ); }
Update As Enlil pointed out, {1} is implied by \d... I guess I more or less meant it to color the fact it was only one digit hungry.
YA update Ok, i will try to actually read before posting next time. As Cody Pendant pointed out, the intent seems to be only these characters, not CONTAINS these characters.
|
|---|