Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with removing something from string
Message
From
27/01/2001 17:12:11
 
 
To
27/01/2001 15:06:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00469416
Message ID:
00469441
Views:
29
>>Hi everyone,
>>
>>I have this problem: my application returns a string which is form of where condition, e.g.
>>
>>"SiteMstr.ccode='01' and inslist(TranMstr.Lender,code1, code2) and etc."
>>
>>We're going to implement Data Warehouse algorithm, and therefore, I want to exclude all references to Table aliases from this string. The tables are limited to just three (may be four):
>>SiteMstr
>>TranMstr
>>PropMstr
>>
>>My problem is that I don't know, how did I spell it, e.g. it could be:
>>Sitemstr
>>SITEMSTR
>>SiteMStr
>>etc.
>>
>>Of course, since it's my application, I can go through the form code, and use just one name convention everywhere, like "SiteMstr", but I'd like to know, perhaps there is more elegant solution.
>>
>>I guess, RegExp should help me here, but I don't know, how to use it in this case.
>>
oRegExp = CREATEOBJ('VBScript.RegExp')
oRegExp.Global = .t.                 && translate all occurances
oRegExp.IgnoreCase = .t.             && case insensitive
oRegExp.Pattern = '\b\w{4}MSTR\.(.)' && word boundary, followed by 4 word chars
                                     && followed by MSTR., followed by any char
                                     && other than a newline, remembered as $1
cTranslate = oRegExp.Replace("SiteMstr.ccode='01' and inslist(TranMstr.Lender,code1, code2) and etc.",'$1')
? cTranslate
>>Thanks a lot in advance.
>
>Nadya,
>What does case differ ? IOW how would you use it ? In something like atc() or find&replace ?
>In a string operation you could combine atc() and stuff().
>Cetin
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform