I am trying to make a regex which will match the following formats so that I could end up with an array of the surname, first name/initial and title.
- SURNAME/A.MR
- SURNAME/A.B.MR
- SURNAME/MR
- SURNAME/.
A and B could potentially be greater than one character.
It’s driving me crazy. I can match the SURNAME and the A or the SURNAME and the MR. But just can’t figure it out.
Any help would be greatly appreciated.
Try something like this: