DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Parsing text

 
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
m_b
Member


Joined: 23 Jun 2004
Posts: 15

PostPosted: 28/07/04 09:57    Post subject: Parsing text Reply with quote

How can I parse a string which looks like this:

name1=value1 name2=value2 name3=value3

and

name1: value1; name2=value2; name3=value3

and

name1=value1&name2=value2&name3=value3

Values may be quoted, like name1="value1",
but not like name1: "value1",into two variables which would be name, value: string;

I need this so I could parse HTML element attributes from text, which look like this:

<input type="submit" name=s1 value="Submit query" style="bgcolor: #ffffff; color: #000000">

And also for url parameters which look like this:

http://www.delphiarea.com/forum/posting.php?mode=newtopic&f=5

It would be nice to have a function like: GetAttribute(wholeText, attributeName: string): string;

Can anyone show me how to do this, cause I have no idea how to do it and I'm desperate???

Thanks in advance...

m_b
Back to top
View user's profile
m_b
Member


Joined: 23 Jun 2004
Posts: 15

PostPosted: 08/08/04 14:34    Post subject: Reply with quote

Never mind, I solved it myself...
Back to top
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group