'>>> t = Textile()
>>> t.image(\'!/imgs/myphoto.jpg!:http://jsamsa.com\')
\'<a href="http://jsamsa.com"><img src="/imgs/myphoto.jpg" alt="" /></a>\''

def image(self, text):

    pattern = re.compile(('\n                                                (?:[\\[{])?                                        #    pre\n                                                \\!                                                                    #    opening    !\n                                                (%s)                                                            #    optional    style,class    atts\n                                                (?:\\.    )?                                            #    optional    dot-space\n                                                ([^\\s(!]+)                                    #    presume    this    is    the    src\n                                                \\s?                                                                #    optional    space\n                                                (?:\\(([^\\)]+)\\))?        #    optional    title\n                                                \\!                                                                    #    closing\n                                                (?::(\\S+))?                                #    optional    href\n                                                (?:[\\]}]|(?=\\s|$))    #    lookahead:    space    or    end    of    string\n                                ' % self.c), (re.U | re.X))
    return pattern.sub(self.fImage, text)
