local jpatt = "t1%-cfr%.enc"
local tag = "?tag??"
local targenc = "?targenc??"
local mcontent='ylyri-t1 LibrisADFStd-Italic <t1-cfr.enc <ylyri8a.pfb " fontinst-autoenc-t1-cfr ReEncodeFont "'
local new_mcontent = (string.gsub(mcontent,"(%<%[?)" .. jpatt .. "( %<%w+%.pfb \" fontinst%-autoenc[%w%-_]*)( ReEncodeFont)", "%1" .. targenc .. "%2-" .. tag .. "%3"))
print (new_mcontent)
local new_mcontent = (string.gsub(mcontent,"(%<%[?)" .. jpatt .. "( %<%w*%.pfb \" fontinst%-autoenc[%w%-_]*)( ReEncodeFont)", "%1" .. targenc .. "%2-" .. tag .. "%3"))