I had to find out what observations in my dataset were such that the individual i was a person instead of a firm, this in formation was represented by individual’s i name in a string variable…how could I do that in a not time-consuming way?…Using:

tab id if regexem(xxx)

where xxx is a condition, which can be simply a part of the name. For instance, many Italian firms’ names end with s.p.a. (= joint stock company); in order to find which individuals are firms all the firms of this kind:

tab id if regexem(individual, “S.p.a”)

where “individual” is the name of the var and “S.p.a.” is the portion of the string variable.

To make have a clearer idea of what I am talking about, you can visit the following web-page: http://www.ats.ucla.edu/stat/stata/faq/regex.htm