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 

regexp and its *maddening* ways of handling vars

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


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sat Jul 08, 2006 6:53 am    Post subject: regexp and its *maddening* ways of handling vars Reply with quote

::rant::
Can someone explain why regexp will work with something like:
Code:

set mylameregexp "blah blah($somevarIwanttoGrep) blah"
regexp $mylameregexp $varIamGrepping match myvar

But WON'T work with:
Code:

regexp {blah blah ($somevarIwanttoGrep) blah} $varIamGrepping match myvar

yes I realize that the $ is supposed to indicate an end of line, but then, why does $mylameregexp work? Nevermind, I think I know the answer Razz


Trying to set certain patterns in vars is itself an exercise in creative kludging...

::end rant::
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Jul 08, 2006 7:16 am    Post subject: Reply with quote

If you replace the braces ({}) with quotes ("") it will be the same.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sat Jul 08, 2006 11:24 pm    Post subject: Reply with quote

Good to know, thanks 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