When I use regular expressions to remove leading and trailing white space, if the field contains any number of '$' characters, half of them will be removed.
For example, "$$$$" becomes "$" and "$$$$$$$$" becomes "$$", because each regular expression removes half of the '$'.
These are the regular expressions I'm using.
"^\s*" --> ""
"\s*$" --> ""
I haven't tested this behavior in any other regular expression matching software, but I don't think this is the exprected behavior.