Statalist


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

Re: ***SPAM*** AW: ***SPAM*** st: AW: parsing problem


From   Federico Belotti <[email protected]>
To   [email protected]
Subject   Re: ***SPAM*** AW: ***SPAM*** st: AW: parsing problem
Date   Thu, 07 Jan 2010 18:22:35 +0100

thanks very much for your help!

I've another question about mata. I'm working with the regexm() function in mata.
My question is the following code. Try directly the code...

clear
input str18 date
20jan2007
16June06
06sept1985
21june04
4july90
9jan1999
6aug99
19august2003
end

*** -regexs()- function works perfectly with stata
gen day = regexs(0) if regexm(date, "^[0-9]+")
list day

tomata

capture mata: mata drop example()
mata

real matrix example(var)
{
/// -regexm()- function seems to work with vectors

one = regexm(var, "^[0-9]+")
one

two = J(8, 1, "")
*
*   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/



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