I have a string,
DXD RO 012345 SMITH JOHN 094 5251 907 REQ 008313 M
I am trying to extract the phone number, which might have 5-15 digits, with unknown amount of white spaces. Also i need the last letter (sex) and the first name.
what is the exact pattren to do so ?
$matches[1] contains the telephone number and $matches[2] contains the sex.
For this, I assumed that columns 1,2,4,5 and 9 only contain letters, and 3,6,7,8,10 only digits(the sex has to be a letter).
However, if you need to have digits as well as letters, just replace [a-z] or \d with [a-z0-9] for the respective column(\s is whitespace)