I am trying to preg_match "Carlos" form this line Carlos Torres General Manager carlos@torres.com Trebol Power Systems 2344 Blue Pacific Dr. W. Jacksonville FL 31257 954-608-5555 1-9 Other Wholesale
but its returning a "W" preg_match('/\b[a-zA-Z0-9]\b/',$line,$fname);
output: First name is W
Got any tips?
Thanks, Abe
You must add the + quantifier!
preg_match('/\b[a-zA-Z0-9]+\b/',$line,$fname);