Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing ideas, maybe regular expression search
Message
 
To
02/03/2004 20:30:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00882554
Message ID:
00882663
Views:
19
>>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
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform