Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: regular expressions in Stata

From   scott hankins <>
Subject   st: regular expressions in Stata
Date   Tue, 13 Sep 2005 13:34:29 -0400


I am trying to use the new regex functions and am having some issues.

I am familiar (but not an expert) with regular expressions in Perl and
I am problems applying that knowledge in Stata. Does anyone know how
regular expressions are implemented in Stata? Ideally, I would like
more than "Regular expression syntax is based on Henry Spencer's NFA
algorithm and as such, is nearly identical to the POSIX.2 standard."
as I have not been able to find a clear exposition of the POSIX.2
standard online (I am sure there is one, I just can't find it :) ).

here is my problem


I tried the following code but it did not find any matches, this
should find all 4 of the above occurrences.

replace weight = 3 if regexm(pdx,"V76(4|5).3")

thanks in advance


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index