Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VBRegExp query
Message
De
18/01/2001 12:46:48
 
 
À
18/01/2001 11:50:50
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00465188
Message ID:
00465224
Vues:
15
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform