[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: regular expressions: escape characters handled incorrectly
Hi y'all. Been a while.
Found a problem with Stata's regular expression parser. It doesn't
handle escapes (\'s) correctly. Was doing this while writing a regular
expression to verify a valid varlist in a very non-standard syntax
di regexm("(id1-2)", "\([\-0-9]*\)")
The \-\0-9 in the  should match numbers (0-9) and dash ("-"), but
reads the escaped dash as another range operator. The specific error
regexp: invalid  range
If anyone has a hack to obtain an equivalent regexp, or if Stata has
any comments, gratitude in advance.
* For searches and help try: