Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Regular Expressions
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01429937
Message ID:
01429947
Vues:
125
This message has been marked as the solution to the initial question of the thread.
Something like this? (Not very refined)
clear
TEXT TO lcList NOSHOW FLAGS 1 PRETEXT 1 + 2 + 4
	Vic: Lastname, Firstname
	Vic: abc, def
	Vic: xyz, wrt
	Vic: test, test
	Vic: somelastname, someFirstname
	Vic: hugo, victor
ENDTEXT

loRegEx			= Createobject('VBScript.RegExp')			&& Create a regular expression.
lcRetStr			= ''
with loRegEx as VBScript.RegExp
	.Pattern		= '(Vic: )(\w+, *)(\w+)'		&& Set pattern.
	.IgnoreCase		= .T.						&& Set case insensitivity.
	.Global			= .T.						&& Set global applicability.	   
	
	lcRetStr		= .Replace(lcList, '$2*****')
ENDWITH
	
? lcRetStr
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform