Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compare Two Strings
Message
From
20/05/2005 14:18:23
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7
Miscellaneous
Thread ID:
01016294
Message ID:
01016303
Views:
8
This message has been marked as a message which has helped to the initial question of the thread.
>All:
>
>I need to parse two strings and return the differences in HTML formatted code string.
>
>For example:
>“This is test of the HTML text comparison parser”
>“This is a test of the new parse HTML page text comparison parser, developed by us”
>
>Resulting string:
>“This is a test of the new parse HTML page text comparison parser, developed by us
>
>Can this be done in VFP? Seems to me I would have to do something like this using regular expressions; if so are there any utilites that can I can use to in VFP to call regular expressions?
>
>Any ideas?
>
>Thanks!
>
>--Paul

like a start point:
CLEAR
x="This is test of the HTML text comparison parser"
y="This is a test of the new parse HTML page text comparison parser, developed by us"

FOR k=1 TO ALINES(aWords,CHRTRAN(m.y,[,],[ ]),[ ])
   IF [ ]+aWords[m.k]+[ ] $ [ ]+m.x+[ ]
      LOOP
   ENDIF
   m.y = ALLTRIM(STRTRAN([ ]+m.y+[ ],[ ]+aWords[m.k]+[ ],[ <b>]+aWords[m.k]+[</b> ]))
NEXT
? m.y
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform