in reply to new to perl : how to match ?
#!/usr/bin/perl -w use strict; while (<DATA>) { my $string = (split)[2]; # extract the 3rd "word" print "$string\n" if $string =~ /^[gH]/; #output if it begins w +ith a "g" or a "H" } __DATA__ data to gbsdff03dfif7 is data to HR620-Asdf2 data to HP650dfgd-Af452 is
|
|---|