Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing ideas, maybe regular expression search
Message
 
À
02/03/2004 20:30:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00882554
Message ID:
00882663
Vues:
20
>>Hello,
>>Not quite sure how to accomplish this. I have a large text file that contains !! in various places. It also contains single !'s. I would like to look for just the single !'s. I didn't really want to get into the WScript regular expression thing ( for one, I wouldn't even know what the regular expression would look like ). Here is something along the lines of what I would like to do:
>>
>>
>>lnExcPts = occurs( '!', lcMyString )
>>for lnI = 1 to lnExcPts
>>     lnStart = at( '!', lcMyString, lnExcPts )
>>     *do some processing here
>>endfor
>>
>>
>>The problem is that this will find all occurences of !! as well. I only want the singles. I'm working on setting it up to read the character before and after the current one and checking for the extra !, but that just kinda seems cheesy to me. Got any idea's?
>>
>>jfh
>
>You might proceed as follows:
>
  • Replace "!!" with some other text, one you are sure will not appear in the regular text. For example, replace "!!" with "!tempmarker!".
    >
  • Process the single "!".
    >
  • Replace "!tempmarker!" with "!!".

    IMHO, in such case "!!" should be replaced by different weird character(s) not using single "!"
    That would allow to avoid any confusion with "!"
    Nick Neklioudov
    Universal Thread Consultant
    3 times Microsoft MVP - Visual FoxPro

    "I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
  • Précédent
    Suivant
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform