I'm working on an online survey which rates the performance of a member group. The surveys will be printed for review by a committee, but the member's names need to be anonymous. Each survey has a comments field and many comments contain the member's name, which needs to be replaced with the anonymous number.
Each survey is linked to a database with all the member's names. At present, I am simply doing a str_replace on the comment field for the name associated with each survey and replacing the name with an anonymous number. The problem falls when the name is slightly mistyped. Also, first names may or may not be included and would ideally be replaced as well (including abbreviated forms of the first name).
Can someone suggest a way to dynamically create a pattern to replace based on the names listed in the member database (about 400) which would find the last name (w/ mis-spellings) as well as the first name if present?
Regular expressions are NOT a strength of mine, help is very much appreciated!
Thanks!