Hi,
i have a script pre made that relays information from one channel to another, but i require the outputted information to be pre regex formatted. So that its put in normal at channel A and the output in channel B is regex.
anyone got any ideas ? been looking for a while cant seem to get it right
De Kus wrote:How is an output supposed to become a regex? Either a string is an regular expression, or it just a string.
well its just url conversion so im guessing just a string im very unfamiliar with regex to be honest ( working on that tho ) an example output would be
Channel A relays goto irc.somewhere.net
Channel B outputs goto irc\.somwehere\.net
least i think thats right again im still reading up on regex :/
from my knowledge it needs to work the same way unrealircd's does
You can try it on your own tcl shell if you dont trust me . Just a little note, when you use "" instead of {} you will need to use ". \\\\." .
lol thank you and aplogies :/
appreciated i'll have a play now.
and no not that i dont trust you or anything like that at all more a case of its very new to me and im not exactly the greatest scripter going as is, so do just need longer to run these things thru my brain.
do you want to strip leading and trailing spaces?!
then you should have scrolled down the string manual some more, string trim will delete them.
just: [string trim $text]
PS: dont use list commands on strings. list commands are intented to be used with proper lists only (made by split, list or lappend).
De Kus wrote:do you want to strip leading and trailing spaces?!
then you should have scrolled down the string manual some more, string trim will delete them.
just: [string trim $text]
PS: dont use list commands on strings. list commands are intented to be used with proper lists only (made by split, list or lappend).
Yep thats ok, but still only outs puts the first word in the relay :/ i thought parhaps [string wordstart $text wordend ] might do it but alas still only one word and a fair few hundred rehases trying to rack my braina round it
well that's what i was looking at too, but i think ive goofed up somewhere else int he script could it be possibly this bit since it was mentioned earlier as being incorrect
X-Ception wrote:well that's what i was looking at too, but i think ive goofed up somewhere else int he script could it be possibly this bit since it was mentioned earlier as being incorrect
this line is the reason for your "one word" problem.
btw... after that line $text is a string again. drop that lindex thing. oh, btw. if you want to elimiate multiple white spaces... this wont be enough . that might be the first time you could consider using regsub .
ex.: regsub -all {\s+} $text { } text