| View previous topic :: View next topic |
| Author |
Message |
ZeRoMe Voice
Joined: 01 May 2006 Posts: 2 Location: France
|
Posted: Thu May 18, 2006 12:17 pm Post subject: [regsub] Parsing problem |
|
|
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 |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Fri May 19, 2006 8:10 pm Post subject: |
|
|
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 |
|
 |
|