Wouldn't you want to be on the safe side and check for tabs and spaces after
the semi-colon before the CR and LF?


-----Original Message-----
From: Mike yearwood
Sent: Wednesday, July 23, 2008 5:06 PM

Hey Garrett Fitzgerald

Remember you were using regex to clean up SQL commands?

TEXT TO m.lcSQL TEXTMERGE NOSHOW
SELECT ;
        0 as nSelected, ;
        m.ptCutOff AS dCutDate, ;
        members.uid, ;
        members.mkey, ;
        members.surname ;
   FROM ;
   members
ENDTEXT

loRegex=CREATEOBJECT('vbscript.regexp')
m.loRegex.Global = .t.
m.loRegex.Pattern = ";\r\n(\t|\s)+"
m.lcSQL = m.loRegex.Replace(m.lcSQL,"")
_cliptext = m.lcSQL


Pretty neat stuff Regex. For thos that want to learn it, the pattern is
interpreted as find all occurrences of semicolon+CR+LF and either a (Tab or
Space) and the final plus sign means one or more of those.

Mike Yearwood




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to