Glad they meet your needs.
For VC users who may not be familiar with how regular expressions work, the above commands work as follows:
In each case, the word we want to spell is passed to the command (macro) as payload 1 --> {1} .
James's version:1. He tells VC to make {LastResult} = {1}. This is needed for his next action, which only operates on the variable {LastResult}.
2. He tells VC to look for a particular regular expression pattern in {LastResult}, and to capture that pattern:
- \w is RegEx speak for "any word character". Placing this in brackets is what tells VC to capture and store that pattern every time it is found.
- in the second parameter, he tells VC to replace each match of pattern "\w" with " (matched character)"+ " -"
(see
http://voxcommando.com/mediawiki/index.php?title=Actions#RegExReplace)
3. In the third action, he's chosen to correct the minor problem of the last matched character also being followed by " -", which doesn't look so nice in the OSD message. This action looks for dash character that is at the end of the string, and replaces it with nothing.
My version:1. Using Results.RegEx, I have the option of telling VC to search for a pattern in a string other than {LastResult}. Because of this, I'm able to directly look for and capture the pattern "\w" in {1}.
2. In the next action I concatenate together all the matches found, adding the delimiter " - " between the matches to create one string of the form: "\w - \w - \w". This concatenated string is now my {LastResult}.
(see
http://voxcommando.com/mediawiki/index.php?title=Actions#MatchConcat)
---------------------
A cheat sheet to learn common regular expressions:
http://www.mikesdotnetting.com/article/46/c-regular-expressions-cheat-sheet.
The RegEx tool in VoxCommando actually includes a link to that cheat sheet and a couple other online resources.