| |
| |
| |
|
Page: 1 2 3 4 5
Comments:
<0> got <0> :) <1> foreach idx [array names env] { puts "env($idx) = $env($idx)" } <2> % regexp -nocase -all -inline {<(:?[a-z]+).*?>(.*?)</\1>} {<sometag text="test"> <2> the text</sometag> text even more <anothertag>anothermatch in here</anothertag>} <2> {<sometag text="test">the text</sometag>} sometag {the text} {<anothertag>anothe <2> rmatch in here</anothertag>} anothertag {anothermatch in here} <2> so you can go through it with a loop <1> holy crap :O <2> ;puts a <2> where is safetcl when you need him? <2> anyway <2> proc untag { args } { set args [join $args]; foreach {s t c} [regexp -nocase -all -inline {<([a-z0-9]+).*?>(.*?)</\1>} $args] { puts "$t :$c" } } <2> % untag "<sometag>text</sometag>" <2> sometag :text
<2> % untag {<sometag key="some value here" another="key">text even with <> in it</sometag>} <2> sometag :text even with <> in it <1> actually <1> all i needed was this: <1> {<.*?>.*?</.*?>} <1> but you provided the clue with the ? <1> just had to make the exp non-greedy <1> thanks! <2> you should still <2> back reference <2> or it will match weird stuff on <1> example? <1> as in what it might match that i don't want to <2> <tag> text <b>bold</b> the tag goes on here </tag> <2> there it would match <1> i have no nesting <2> text <b>bold <2> instead of <2> text <b>bold</b> the tag goes on here < <1> this what i've got at the moment: <1> set str {My name is <bold>John Smith</>. Please make sure you <i,b>write that down</>. Do you <color=red,b>really < < know</> how to write? <c=blue,i,bold>That's / great!</>} <1> set expr {<.*?>.*?</.*?>} <1> foreach item [regexp -all -inline $exp $str] {puts $item} <2> and what should that match? <1> all the tagged items <2> you dont have one valid tag in there? <1> they aren't html <1> [12:29] <@BL4DE> that's some strange html :) <1> [12:29] <1> i am writing some custom tagging stuff <1> [12:30] <1> like <1> [12:30] <1> My name is <b,c=red>John Smith</> ... please write it down." <2> oh didnt see that <2> so </> is the closing tag? <1> yeah <1> no nesting <1> run those three lines, you'll see what i mean <2> {<[a-z0-9,=]+?>(.*)</>} <2> why do you use </.*?> <1> wanted to include the closing tag, i guess? <1> oh sorry <2> well the closing tag is always </> <2> isnt he? <1> sometimes user might accidentally put in </bold> <1> just to cover for it <3> Somebody bring in a bot running pubsafetcl please... I can't make mine run. <4> you broke it? <3> yah I broke my Debian box.. =/ <4> doh <3> Or really, the Debian maintainers broke it.. =P <3> It's all THEIR fault. =) <3> ;info patchlev <5> FireEgl: #5 (277 clicks) Tcl: 8.5a3 <6> =] <3> Tanks ;) <6> np, just pm when you want me to remove it <3> okee <2> mhm <7> oooh, and all-new bot to break <6> do not delete the namespace now.. it's running the unfixed ver.. <7> :( <2> whats bold again?
<2> \001 ? <3> \002 <2> ;puts \001 what \002 what \003 what <5> Gotisch: #25 (1643 clicks) Tcl error: can't read "socket": no such variable <6> \001 is raw <3> \001 would be for prefixing/suffixing CTCPs and CTCRs <2> ;puts "\001 what \002 what \003 what" <5> Gotisch: #28 (stdout) what what what <2> ah <6> zanpaktou putserv "PRIVMSG #tcl :\001ACTION test\001" <2> ;puts "\004 what \005 what \006 what" <5> Gotisch: #30 (stdout) what what what <2> whats underline? <6> \037 <2> proc do_parse { what } { foreach entry [split $what ,] { <2> switch -- $entry { "b" { append result \002 } "u" { append result \037 } } <2> } <2> if {![info exists result]} { return $what } <2> return $result <2> } <2> ;do_parse nothing <5> Gotisch: #34 (778 clicks) Tcl: nothing <2> ;do_parse b <5> Gotisch: #35 (534 clicks) Tcl: <2> ;puts "[do_parse b]bold" <5> Gotisch: #36 (stdout) bold <2> ;puts "[do_parse u]underline" <5> Gotisch: #37 (stdout) underline <6> you should end it properly also <6> ;regsub -all -- {%b\{(.*)\}} "testing %b{this ****}" \002\\\0\002 <5> yoe: #39 (794 clicks) Tcl: testing \ <6> ;regsub -all -- {%b\{(.*)\}} "testing %b{this ****}" \002\\0\002 <5> yoe: #40 (283 clicks) Tcl: testing %b{this ****} <6> wops <6> ;regsub -all -- {%b\{(.*)\}} "testing %b{this ****}" \002\\1\002 <5> yoe: #42 (274 clicks) Tcl: testing this **** <6> ;regsub -all -- {%b\{(.*)\}} "testing %b{this ****} and some other text" \002\\1\002 <5> yoe: #43 (288 clicks) Tcl: testing this **** and some other text <8> isnt it easier just to add %b on both sides ? <2> ye <2> you could even make a proc b <6> it's easier to read this way. =) <2> proc b {} { return \002 } <8> like its hard to read :) <2> ;puts "[b]bold[b] that is" <5> Gotisch: #50 (stdout) bold that is <6> bah, extra procs for that.. bleh <2> bah extra regsub for that.. bleh <2> :P <6> tss <2> ;return "[b]bold[b] that is" <5> Gotisch: #55 (447 clicks) Tcl: bold that is <2> ;time {return "[b]bold[b] that is"} <5> Gotisch: #57 (325 clicks) Tcl: 19:56 <2> bah <2> i forgot <6> zanpaktou proc b {} { return \002 } <6> zanpaktou time {return "[b]bold[b] that is"} <5> <0.0ms> wrong # args: should be "time" <6> eh <8> time is taken over by one of the scripts u loaded <5> BL4DE: #61 (331 clicks) Tcl: 19:57 <8> alltools ? :) <9> my bot seems to do a (Read error: EOF from client) once in a while i think it might be because of a http problem, possible timeout ? and the eggdrop dies. is there a way to prevent this <9> im getting no errors from the bot <2> yoe i was actually playing with regsub too <8> use timeout on ur http requests <2> but i was trying it on <9> how <2> those custom tags <2> chilla had <9> ?? http <10> [What-is] That term has not been defined.
Return to
#tcl or Go to some related
logs:
#sex oullet openbsd #beginner #politics #politics #politics #nhl mysql default on insert current_timestamp #stocks #nhl
|
|