PDA

View Full Version : new bot problem :)


inkedmn
11-10-2002, 04:29 PM
ok, most of the folks on IRC know about my fight with this, but i thought i'd let the rest of ya take a crack at it :)

ok, so joanabot is doing factoids now, but there's one small snag. the command to add a factoid is:
"-set someFact = someValue"

now, if the key (someFact) contains a single quote ('), it has to be espcaped before it's plugged into the sql statement. so, an example would be:

brett's factoid = brett\'s factoid

so, basically, my question is this:

how can i replace this -->(') with -->(\') ?

i've tried regular expressions, tokenizing the string at the single quote, and neither is working for me.

any ideas?

inkedmn
11-10-2002, 11:31 PM
ok, once again, i'm a retard...

found out that if i use a PreparedStatement, it automatically takes care of escaping everything, so...

thanks anyway :)

kmj
11-11-2002, 12:04 PM
your welcome!!! :)