| |
| |
| |
|
Comments:
<0> s/\^/\\\^/g; <0> oops. <1> Excelletn. <2> hello? <1> NO <1> Woo, best response time ever. <0> http://simmy.pastebin.com/710650 <0> This is a subroutine in my irc bot that's SUPPOSED to handle dealing with the nick!user@host and possible non-regex-friendly characters. It's SO not working. Output is always the exact same string of numbers. Why? <1> Um
<1> ARgh <1> pastebin <1> simmy: What on earth are you trying to accomplish here? <2> to escape certain chars <2> though.. <1> Um. Why? <1> If you want to escape regex sensitive characters thare are much better ways to do it. <2> s/[{}\[\]\^\|\@/\\\1/g <2> s/[{}\[\]\^\|\@]/\\\1/g <2> would do the same thing <1> fuehrer: quotemeta <1> Would do the same thing in something resembeling sanity. <1> But I'm trying to understand *why* <1> Fascinating. <2> well <2> I ant explain why <2> I can <2> but I've too many other things to worry about atm <2> so, I'd recommend reading perldoc perlre <2> and such things <1> fuehrer: Who are you talking to? <2> you <1> Why did you tell me to read perlre? <2> cuz you need to <1> Why? <1> Figures. <2> oh and <2> sorry <2> I'm ****ed in the head atm <2> amazed I can sit upright <2> so yea <0> I've got a file that's a list of nick!user@host ... some of those nicks contain regex-sensitive characters []{}\^ ... I want to make sure that when I take and search against somenick^!user@host.com that ^ is escaped BEFORE it goes into the regex. Shouldn't that subroutine do that for me? <2> **** ups <2> s/([{}\[\]\^\|\@])/\\\1/g <2> I meant that <2> oh <2> well
<2> it wont matter in the string being compared to <2> if you are checking these strings with a regex <2> it dont matter eh <2> um <2> might reconsider approach <2> if it is a problem <2> cuz it shouldnt be <2> if you're going about things in a proper manner <0> but I'm already having issues like when this script tries to work against nick[ the script bitches because I've got an unclosed bracket. <0> if ($this=~/nick[/) {...} ... the thing gripes. <2> well <2> what are you trying to accomplish in the end? <0> it's an IRC bot. I want the bot to read in this|nick!user@host and later, compare it against an arbitrary nick. So, ***ume $weirdnick="this|nick" <0> if ($somevariable=~/^$weirdnick$/) {...} <0> that wouldn't work because | is read as something other than the \| character. I'm trying to get those few characters escaped by the program before it tries to do anything regex-wise with them. <2> ah <0> got it... <0> i had = ~ instead of =~ <3> Roarr! <3> -!- mode/#perl [+o xterm] by TopMach <4> hehe <3> =] <3> I feel the power! <3> thanks XD <4> Hope that satisfies you. :) <3> I was satisfied before it haha. <3> now i'm just extatic! <4> good <3> me go smoke! <3> *** <3> what was that god damn F'ing command that displays the line number in vi <5> mmm.. <5> i can never remember that either <3> :set nl <5> L <5> ? <3> u <3> sorry <3> :set nu <5> nope, not L <5> ctrl+g will show the current line number <5> thank you, almighty google <3> :2 <3> mt
Return to
#perl or Go to some related
logs:
#asp www.tamildeejaynetwork.com
#kl #kl tomyamsup zsuatt #linux ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo #india #chat-world
|
|