| |
| |
| |
|
Page: 1 2 3 4 5
Comments:
<0> its overly complex. <1> is it? <0> to do it without regex? yea <1> bleh <0> which part are you trying to process <0> the message or the full line <1> full line, i guess <0> you guess? <1> haven't thought about a solution yet, just wanted to know if it's useful to code without the use of a regex
<2> what are you trying to do at all? <2> check a random [ ] box? <1> like a poll with a random answer <0> i would just do tokenize 93 $gettok($1-,%i,91) <1> yep <0> $1 would be the X (or not) and $2- would be the reason <0> ***uming you're at the line part and not the timestamp/nick <1> mhh? <0> oh wait, <2> yeah, its fairly easy without regex as well <0> i mean, var %line = $1- and tokenize 93 $gettok(%line,%i,91) <2> just use $count $pos $left and $mid <0> ew. <1> hmm <1> $count(string,substring,substring2,...,substringN) <1> Returns the number of times substring occurrs in string. <1> ah :) <1> 1 <1> 2 <1> hah <0> 3. <0> //var %i = 1, %line = [x] hello [[ ]] world | while ($gettok(%line,%i,91)) { tokenize 93 $v1 | echo -a checked: $iif($2,YES,NO) comment: $iif($2,$2,$1) | inc %i } <2> nice 'n all, but that's not what he asked :p <0> isnt? <1> not really <1> sat: where to use that $mid for? <0> oh you're generating the output with no input? or you're taking input and generating output? <2> well.. as easy replacement for $right <2> you'd want everything left and everything right from the place where you want to put an X in <2> i'd use $mid for the right part, because it's simpler than using $right <2> lemme just give you my solution <2> alias checkrandombox { if ($pos($1-,[[ ],$rand(1,$count($1-,[[ ])))) return $+($left($1-,$v1),X,$mid($1-,$calc($v1 + 2))) } <1> can't i use an instok @ N place? <2> you can try <1> hmm
<2> but i'm curious as to what C you'd use in that case ;) <1> a 'X' ? <2> you don't have a 'X' to begin with <2> you could use 93 like arg did i suppose, but i doubt it'll get any easier that way <1> [] test [] test2 <1> hihi <1> ;( <2> err, please test elsewhere <1> sorry <1> hmm, i'm tired, will try again tomorrow <1> thanks anyways! <2> :) np <0> http://www.holycraplions.com/paste/1298 <0> heh <2> :/ <0> dynamic regex generation would be so much nicer <0> / $+ $str(([\s+]).+?,$count($1-,$chr(91) $chr(93))) $+ / <0> or somethin <0> it worked in my head, but i have to go <0> so lata <2> o/ <0> //var %n = 3 | echo -a /(?< $+ $remove($reptok($str([\s+] .+? $chr(32),3), [\s+], $chr(41) $+ ([\s+]) $+ $chr(40) $+ ?=, $rand(1,%n), 32),$chr(32)) $+ )/ <0> ? <0> i dont know lookahead/behind syntax <0> oh that wouldnt work anyway <0> good try though, this time im gone for real <2> no $rand ? <2> oh there it is, nm <0> yea but lookbehind doesnt support variable lenghts <2> yeah that ****s <0> i guess you could just do \1 \2 \3 <0> //var %n = 3 | echo -a /( $+ $remove($reptok($str([\s+] .+? $chr(32),3), [\s+], $chr(41) $+ ([\s+]) $+ $chr(40), $rand(1,%n), 32),$chr(32)) $+ )/ <0> //var %n = 2, %re = /( $+ $remove($reptok($str([\s+] .+? $chr(32),3), [\s+], $chr(41) $+ ([\s+]) $+ $chr(40), $rand(1,%n), 32),$chr(32)) $+ )/ | echo -a %re => $regsubex([ ]] hello [[ ]] world, %re, \1 [X] \3) <0> almost works <2> werent you going or something <2> ;p <0> i realized i dont have to leave just yet <0> and this is too much fun to p*** up <2> heh
Return to
#mirc or Go to some related
logs:
#stocks #dsl #heroin #stocks #hardware #politics gog and magog America Usage: date [OPTION]... #windowsxp spartigis
|
|