Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Cory Smith <corybsmith@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Cleaning Strings and Regular Expressions |
Date | Wed, 23 Nov 2011 17:57:52 -0500 |
Hiya all, I'm looking to use regular expressions or another command to remove an arbitrary list of characters from a string. For example, I might want to remove all punctuation so hi.there,gu;ys. becomes hithereguys I'd love to use regexr, but it only replaces the first substring. Is there a way to use (STATA) regular expressions for this? Otherwise I'm stuck with running subinstr in a for loop. Cory * * 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/