Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Chrtran() applied selectively
Message
De
05/06/2016 12:56:08
 
 
À
05/06/2016 09:21:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01636985
Message ID:
01637027
Vues:
58
And you would be right, of course! Thanks!


>Antonio,
>
>Personally, I would use \d+ instead of \d* to make sure that there's at least one digit present
>
>>Pattern could be simpler, actually.
>>
>>
>>? PATTERNTRAN("1st-title: ANAME-HER : 3520931 place[21~22]", "(\[\d*).(\d*\])","$1.$2")
>>? PATTERNTRAN("1st-title: ANAME-HER : 3520931 place[99 100]", "(\[\d*).(\d*\])","$1.$2")
>>? PATTERNTRAN("1st-title: ANAME-HER : 3520931 place[35-36]", "(\[\d*).(\d*\])","$1.$2")
>>
>>
>>There is no need to identify the separator character as a group. Note that the dot in the pattern represents "any character except line breaks", but in the replacement string it corresponds to a real dot. Also, all matches are being replaced (this could be changed by setting differently the .Global property).
>>
>>For instance
>>
>>
>>? PATTERNTRAN("foo foo bar", "foo","mars")
>>
>>
>>Finally, a great resource to experiment with regular expressions: http://regexr.com/
----------------------------------
António Tavares Lopes
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform