Thanks Jean,
I found the solution and here is the correct RegEx Expression:
(?i)(mr|ms|mrs|rev|dr|prof|miss)\s
Explanation:
(?i) = ensures that all cases are caught. For example, Mr, MR, mr, mR, etc.
| = pipe symbol and acts as an "OR" specifier. It will select any of the listed salutations. You can add others if you want.
\s = ensures that each salutation is selected if it is followed by a space character. For example, "Mr " is selected, but "Mr." is not selected. It also ensures that the space is removed when deleting the salutation.
Intended Use:
I use a client booking program that add clients name to the calendar against a time slot. Sometimes the client's name includes a salutation (Mr Client), but at other times it only lists the client's name (Client). The client list synchronizes with Google Calander. So, the Google Calander can contain appointments with the Client Name or the salutation and the client name.
I use Roam Research to record my client notes. An extension allows me to import the Googe Calendar for a particular day. I have configured it to surround the client's name with double square brackets so that Roam Research creates a page for each client. For example, Client imports into Roam Research as [[Client]]. However, I found that some clients were entered with a salutation ([[Mr Client]]), resulting in a client having two pages.
To overcome this, I decided to try and use QCE to search for, select and delete the salutation to ensure that clients notes are only linked to a single page.
Lessons and Discoveries:
[/url][url=https://www.autohotkey.com/docs/commands/RegExMatch.htm]AutoHotkey’s regular expressions are implemented using Perl-compatible Regular Expressions (PCRE) from www.pcre.org.
The current QCE does not save the Regex search criteria (I listed this in a separate message).
Use the new BING CHAT feature to quickly find the correct RegEx expressions. It helps to specify the "flavour" of RegEx your program uses. Specifying AHK is enough.
I hope this helps someone.
Rennie