Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Continued comments ...
Message
De
21/03/2000 19:16:39
 
 
À
21/03/2000 16:19:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00348010
Message ID:
00348667
Vues:
37
>>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.
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