Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VBRegExp query
Message
From
18/01/2001 12:46:48
 
 
To
18/01/2001 11:50:50
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00465188
Message ID:
00465224
Views:
16
>Hi all
>
>I'm trying to get my head around using the RegExp object - so far it's OK but I've come across a problem I can't solve.
>
>My pattern will always be a '*' followed by a word or words and ending with another '*' e.g. *Testing* or *Testing again*. The pattern could occur any number of times in a large chunk of text.
>
>I want to replace the first '*' with '' and the second '*' with '' so the
>end result will be Testing and Testing again
>
>I guess the first question is if this is possible?'
>If so I'm having trouble getting the pattern syntax correct e.g.

Try:
oRegExp = CREATEOBJ('Vbscript.RegExp')
oRegExp.Global = .T.
oRegExp.Pattern = '\*(*)\*'
cSubstituted = oRegExp.Replace(cStringToFix,'< I >$1< /I >') && remove spaces
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