egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[SOLVED] retrieving certain objects

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Fri Jan 02, 2009 7:34 pm    Post subject: [SOLVED] retrieving certain objects Reply with quote

hi ^^

to explain what i like to do:

i catch a line with my bot which comes from a news system but only want to retrieve the news posters nickname - problem is that the news posters nickname sometimes consists of one or two names, in example:

"news added: sony increased sale rates on playstation 3 poster: derrick date: 2009-01-01" <-- one name which i can easily catch with lindex
and
"news added: sony increased sale rates on playstation 3 poster: dick tracy date: 2009-01-01" <-- two names

is there a way to easily retrieve only the posters complete nick?
or is there a way to string match from a special char to a special char?

hope my explanation isnt that bad Smile


Last edited by raider2k on Fri Jan 02, 2009 8:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Fri Jan 02, 2009 8:25 pm    Post subject: Reply with quote

You could use a regexp to get everything between "poster: " and " date:" using something sililar to the following tclsh examples :-

% set data "news added: sony increased sale rates on playstation 3 poster: dick tracy date: 2009-01-01"
news added: sony increased sale rates on playstation 3 poster: dick tracy date: 2009-01-01
% regexp {poster: (.+?) date:} $data -> nick
1
% return $nick
dick tracy
Back to top
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Fri Jan 02, 2009 8:38 pm    Post subject: Reply with quote

geesh!
that worked

thanks very much for your help Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber