Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: special characters for regex


From   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: special characters for regex
Date   Sat, 31 Aug 2013 20:35:46 -0400

The reference to the POSIX.2 standard appears to have been removed from
the -help- for Stata 13- at least I can't find it. Also, the description
of Stata's regex capabilities at
http://www.stata.com/support/faqs/data-management/regular-expressions/
appears to be quite accurate.

I do think that the Manual should incorporate the FAQ information, and
that both should state more clearly what Stata's regex functionscannot do,
just as Kevin Turner did in the communication reported in
http://www.stata.com/statalist/archive/2005-09/msg00364.html


Steve

On Aug 30, 2013, at 7:13 AM, László Sándor wrote:

Thanks, Steve.

FWIW, I think it is a bit misleading to claim being nearly identical
to a standard when there are all these differences. I would not say
that not supporting [:space:] is really about a shorthand here. I do
not even know which whitespace characters could be covered by the
term, esp. as all those are special characters. Or it would be nice if
Stata warned me about trying to use a regex expression they will not
parse…

On Thu, Aug 29, 2013 at 8:24 PM, Steve Samuels <[email protected]> wrote:
> 
> See: http://www.stata.com/statalist/archive/2005-09/msg00364.html
> 
> Steve
> 
> On Aug 29, 2013, at 6:08 PM, László Sándor wrote:
> 
> I burnt myself with these, I regret my incomplete testing. So, for
> others to know:
> 
> Though Stata help says "Regular expression syntax is based on Henry
> Spencer's NFA algorithm, and this is nearly (sic!) identical to the
> POSIX.2 standard." the POSIX.2 standard for special characters (like
> [:digit:] for \d or [:space:] for \s, or either with double
> bracketing) does not work. Worse, they don't produce an error, just
> assume they want to look for the characters between the brackets, and
> for some reason you listed colons twice.
> 
> There seems to be no substitute but to use listing between brackets. Sigh.
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index