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 

Replacing & with &

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


Joined: 13 Mar 2008
Posts: 36

PostPosted: Fri May 09, 2008 6:48 pm    Post subject: Replacing & with & Reply with quote

couldn't figure out an easy way after looking around the forums... maybe i'm being a noob...

probably going to use lreplace to do it?

Code:

foreach tr [regexp -all -inline {<tr class="dlc_info_row">.*?</tr>} $data] {
  regexp {<tr class="dlc_info_row">.*?<td>(.+?)</td>.*?<td>(.+?)</td>.*?<td>(.+?)</td>} $tr - artist title type
 putserv "NOTICE $n :$artist - $title ($type)"
}


is where it is getting my artist and title

I want it to replace any &amp; in $artist or $title with &
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Fri May 09, 2008 8:56 pm    Post subject: Reply with quote

Code:
putserv "NOTICE $n :[string map {&amp; &} "$artist - $title"] ($type)"

As more html elements begin to surface, enlarge the string map to encompass them as well.
Also, do not escape the set of double-quotes inside the string map, they are within command/evaluation brackets.
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