rejetto forum
May 25, 2012, 09:39:18 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: replace command  (Read 402 times)
0 Members and 2 Guests are viewing this topic.
kaler
Experienced poster
***
Offline Offline

Germany Germany

Posts: 94


View Profile
« on: August 29, 2009, 02:19:14 PM »

hello...

when i save a .txt file, then i can say that some codes must be replaced...
so follow code:
Code:
{.replace
|:)|<img src="/chat/smileys/smiley.gif" alt=""/>
.}
now i want make it, that every smile code will be replaced by the smiley.gif
i thought that i must put this:
Code:
{.replace
|{.!:).},{.!:-).}|<img src="/chat/smileys/smiley.gif" alt=""/>
.}

But it doesent work...
what must i write so that : ) and :-) will be the 'smiley.gif'Huh?

Thank you
« Last Edit: August 29, 2009, 02:43:25 PM by kaler » Logged
TSG
Operator
Insane poster
*****
Offline Offline

Australia Australia

Posts: 1919



View Profile WWW
« Reply #1 on: August 30, 2009, 04:37:56 AM »

I am not sure but I do not think you can stack replacements.... You could just do a new line for the new input method. Redudant I know, but it'll do the job.
Logged

kaler
Experienced poster
***
Offline Offline

Germany Germany

Posts: 94


View Profile
« Reply #2 on: August 30, 2009, 04:45:01 AM »

ok thank you...

can you (please) answerd also my other question??? thank you
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11830


View Profile
« Reply #3 on: August 30, 2009, 08:10:21 AM »

the other syntax you tried cannot work.
let's say you have many different smiles to replace,
since they share a lot of the text
<img src="/chat/smileys/smiley.gif" alt=""/>
where only the smiley part changes, because i guess you keep all the images in the same folder!
i would use a short for the first part (before "smiley"), and another short for the second part.
let's say £$% and %$£
(we must hope these are not already present in the text, but it's unlikely to be)

only in the end i would replace the shorts with what they finally should be.

then, it would be something like this

{.replace|:)|£$%smiley%$£|:-)|£$%smiley%$£|;)|£$%blink%$£|;-)|£$%blink%$£|:D|£$%grin%$£|:-D|£$%grin%$£|£$%|<img src="/chat/smileys/|%$£|.gif" alt=""/>|
here goes your text, and it would be nice it to be contained in a variable, and referenced by the 'var' parameter
/replace.}


replace can replace many things in the same text, and it goes from left to right. so the shorts are replaced as last thing.

this problem lead me to add the parameter 'replace' to macro {.regexp.}
will be available in next version
Logged
kaler
Experienced poster
***
Offline Offline

Germany Germany

Posts: 94


View Profile
« Reply #4 on: August 30, 2009, 08:42:00 AM »

i try to understand... thank you for help...
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 15, 2012, 12:38:51 AM