def changeFactoid(self, irc, msg, tokens):
        id = self._getUserId(irc, msg.prefix)
        (key, regexp) = list(map(' '.join,
                            utils.iter.split('=~'.__eq__, tokens, maxsplit=1)))
        channel = plugins.getChannel(msg.args[0])
        # Check and make sure it's in the DB
        fact = self._getFactoid(irc, channel, key)
        self._checkNotLocked(irc, channel, key)
        # It's fair game if we get to here
        try:
            r = utils.str.perlReToReplacer(regexp)
        except __HOLE__ as e:
            irc.errorInvalid('regexp', regexp, Raise=True)
        fact = fact[0]
        new_fact = r(fact)
        self.db.updateFactoid(channel, key, new_fact, id)
        irc.replySuccess()
dataset/ETHPy150Open ProgVal/Limnoria/plugins/MoobotFactoids/plugin.py/MoobotFactoids.changeFactoid