Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Continued comments ...
Message
De
22/03/2000 08:52:18
Paul Frost
Instem Computer Systems Ltd
Stone, Royaume Uni
 
 
À
21/03/2000 19:16:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00348010
Message ID:
00348826
Vues:
25
>>>Ed,
>>>
>>>>Oh, you'd just love to see the uncommented version of a block of code I wrote yesterday:
>>>>
>>>>
oRegExp = CREATEOBJ('Vbscript.RegExp')
>>>>oRegExp.global = .f.
>>>>oRegExp.Pattern = "[^:]//(\w+[\w-]*\w\.)*\w+"
>>>>lcRandomPlaceToStuffAString=oRegExp.Replace(this.Value,"WinNT://$1")
>>>
>>>ROFL! Yeah, I recognized that pattern immediately. It's the one where the programmer puts in lots of unintelligible lines of code that do nothing, but force the client to keep calling them back in -- since no one else can understand it. :-)
>>>
>>>So what does it really do? Maybe strip out excess "/"'s or something like that? Obviously in a real code audit, I'd have to run out and study regular expressions.
>>
>>Finds the substring that starts with // not prefixed immediately by :, up to the first terminating '.' and substitutes WinNT://first matching string. Using it to start building an ADSI call...
>
>PS - in the real block of code, there's three lines of comments regarding the regular expression and some shortcomings in assumptions I made in building it that I haven't coded around yet.

Don't keep us in suspense, lets see the three lines of comment & see if it's any more understandable (especially to someone with only a small amount of knowledge about regular expressions).

Paul
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform