What would be a good approach to set up a macro that detects the presence of the characters .,{}!? in one variable and matches them with equivalent characters (if present) in another variable?
The best I can suggest would be something like this:
If Variable A contains [
Search And Replace Variable B { with [
Search And Replace Variable B ( with [
Search And Replace Variable B } with ]
Search And Replace Variable B ) with ]
If Variable A contains (
Search And Replace Variable B { with (
Search And Replace Variable B [ with (
Search And Replace Variable B } with )
Search And Replace Variable B ] with )
If Variable A contains {
Search And Replace Variable B ( with {
Search And Replace Variable B [ with {
Search And Replace Variable B ) with }
Search And Replace Variable B ] with }
If Variable A matches "[,]$"
Search And Replace Variable B with regular expression [,.!?]*$ with ,
If Variable A matches "[.]$"
Search And Replace Variable B with regular expression [,.!?]*$ with .
If Variable A matches "[!]$"
Search And Replace Variable B with regular expression [,.!?]*$ with !
If Variable A matches "[?]$"
Search And Replace Variable B with regular expression [,.!?]*$ with ?