I'm looking for a regular expression in MSSQL to omit values which 'start' with specific words. For eg., the expression should ignore any string starting with 'Mr' but pull any string which starts with 'MMR' or where 'Mr' is somewhere in the middle of the string:
Sample data:
Should be omitted: 'Mr Murphy Barrera 7329 Neque Road Zierikzee M15 6SF Tonga'
Should not be omitted: 'Murphy Barrera 7329 Neque Road Zierikzee M15 6SF Mr Tonga'
I used LIKE '[^Mr.]'
but that omits everything which starts with M OR R, so it's not doing the trick.
I have a list of such words which need to be checked (eg. Ms, Dr, St etc), so I'd request you let me know how to tweak the regex.
Thanks in advance!