In this, I agree with ADezii - you will never be able to match all patterns for names correctly, but you can solve for all of your data.
I've done this before, and it took quite a few pattern matches to get through a large (ca. 100,000 records) database. I did not fully check every result, but my method left me with high confidence. I started by formulating a solution and testing it. Then, I would spot check the answers, and the failures, before adding additional capability. Here is a pseudo algorithm:
- Build a potential solution
- Run test
- Check result for positive answers, if there is a problem, rework the last solution so that the selection is better/smarter.
- Check the failures, dream up an enhancement to the selection, and add it to the soltuion.
- Restart at test (#2).
The structure of the code that I ended up with was:
-
If Match(input to pattern1) Then
-
Select fields and store.
-
Else If Match(input to pattern2) Then
-
Select fields and store.
-
Else If Match(input to pattern3) Then
-
Select fields and store.
-
Else
-
''--match failure
-
Report failure.
-
End If
-
Happy Hunting,
Oralloy