On Wed, Jun 04, 2003 at 10:33:02AM +0000, Angus Leeming wrote: > I want to add a module to lyxconvert_221.py to change this: > > \begin_inset External RasterImage,"taulogo.png","" > > \end_inset > > to this > > \begin_inset External > template RasterImage > filename taulogo.png > > \end_inset > > throwing away the final arg (here "", more generally "<string>") that holds > the parameters variable. I guess that we could retain the filename within > quotes as LyXLeX will handle that. > > Trouble is, I don't know how to split the line into its constituent parts.
import re mo = re.search(r'\\begin_inset External (.*),"(.*)",', a) if mo: print "template", mo.group(1) print "filename", mo.group(2) This code will fail if the filename contains the char '"' (how does the lyx file look in that case ? )