In http://www.stata.com/statalist/archive/2005-09/msg00364.html,
Frank de Libero posted a summary of Stata's implementation of regular
expressions which he had received from Kevin Turner of StataCorp.
It contained the statement that "... denoting a literal dollar sign
could be done with \$"
This was incorrect. "$" is a reserved Stata character--it is used in
the definition of global macros.
To match a literal dollar sign, one needs a double backslash, "\\$".
Thanks to Kerry Kammire of StataCorp for setting me straight.
-Steve
**************************CODE BEGINS**************************
input str10 item
"$10,000"
end
gen str10 item_w = regexr(item,"\\$","A") //Matches literal "$"
gen str10 item_x = regexr(item,"\$","A") //Matches end position
gen str10 item_y = regexr(item,"$","A") //Matches end position
list
***************************CODE ENDS***************************
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/