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 

[regsub] Parsing problem

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


Joined: 01 May 2006
Posts: 2
Location: France

PostPosted: Thu May 18, 2006 12:17 pm    Post subject: [regsub] Parsing problem Reply with quote

Hello!
Sorry I'm french and my english is'nt verry good ^^
For explain my problem view this example:

.tcl set text {[email=my@email.com]Mon email[/email] [email]my@email.com[/email]}
This is OK.

And when I use:
.tcl regsub -- {\[email=(.*)\](.*)\[/email\]} $text "<a href='mailto:\\1'>\\2</a>" text2; putlog "\00304$text2"

The result is:
<a href='mailto:my@email.com]Jerome[/email] email: [email'>my@email.com</a>

But i want obtain this:
<a href='mailto:my@email.com>Jerome</a> email: <a href='mailto:my@email.com'>my@email.com</a>

Thank you for your help.
_________________
Sorry for my english ^^
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri May 19, 2006 8:10 pm    Post subject: Reply with quote

probably you just need to add another number like "\\1<a href='mailto:\\2'>\\3</a>".
Addionally I would suggest using .*? instead of .* to get the smallest wildcard, not the largest.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN 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