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 

How to read text in front of exact character

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


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Fri Nov 18, 2016 3:06 pm    Post subject: How to read text in front of exact character Reply with quote

For example i have line

text1 text2 [something] text3 text4 [else] text5

How can i read "text1 text2"
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Fri Nov 18, 2016 4:06 pm    Post subject: Re: How to read text in front of exact character Reply with quote

Madalin wrote:
For example i have line

text1 text2 [something] text3 text4 [else] text5

How can i read "text1 text2"



In the above, you seem to be asking how to get the first two words.

Yet in the topic:
"How to read text in front of exact character"

So:
Can you give a better example? Is "[something]" relevant, or not?
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Fri Nov 18, 2016 4:12 pm    Post subject: Reply with quote

Found it .. thanks was looking for something like

Code:
regexp {(.*)\]} $line "" first


there is more work to do after but works.
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
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