• Resolved nicearma

    (@nicearma)


    I’m working in new plugin but i need help with one regular expresion, so please if you can help, i have this

    a:6:{s:5:”width”;s:4:”3000″;s:6:”height”;s:4:”2100″;s:14:”hwstring_small”;s:23:”height=\’89\’ width=\’128\'”;s:4:”file”;s:25:”2012/02/sopa_nicearma.jpg”;s:5:”sizes”;a:3:{s:9:”thumbnail”;a:3:{s:4:”file”;s:23:”sopa_nicearma-15×10.jpg”;s:5:”width”;s:2:”15″;s:6:”height”;s:2:”10″;}s:6:”medium”;a:3:{s:4:”file”;s:25:”sopa_nicearma-300×210.jpg”;s:5:”width”;s:3:”300″;s:6:”height”;s:3:”210″;}s:5:”large”;a:3:{s:4:”file”;s:25:”sopa_nicearma-700×490.jpg”;s:5:”width”;s:3:”700″;s:6:”height”;s:3:”490″;}
    }s:10:”image_meta”;a:10:{s:8:”aperture”;s:1:”0″;s:6:”credit”;s:0:””;s:6:”camera”;s:0:””;s:7:”caption”;s:0:””;s:17:”created_timestamp”;s:1:”0″;s:9:”copyright”;s:0:””;s:12:”focal_length”;s:1:”0″;s:3:”iso”;s:1:”0″;s:13:”shutter_speed”;s:1:”0″;s:5:”title”;s:0:””;}}

    but i want delete this

    s:9:”thumbnail”;a:3:{s:4:”file”;s:23:”sopa_nicearma-15×10.jpg”;s:5:”width”;s:2:”15″;s:6:”height”;s:2:”10″;}

    and have this in the end

    ‘a:6:{s:5:”width”;s:4:”3000″;s:6:”height”;s:4:”2100″;s:14:”hwstring_small”;s:23:”height=\’89\’ width=\’128\'”;s:4:”file”;s:25:”2012/02/sopa_nicearma.jpg”;s:5:”sizes”;a:3:{s:6:”medium”;a:3:{s:4:”file”;s:25:”sopa_nicearma-300×210.jpg”;s:5:”width”;s:3:”300″;s:6:”height”;s:3:”210″;}s:5:”large”;a:3:{s:4:”file”;s:25:”sopa_nicearma-700×490.jpg”;s:5:”width”;s:3:”700″;s:6:”height”;s:3:”490″;}
    }s:10:”image_meta”;a:10:{s:8:”aperture”;s:1:”0″;s:6:”credit”;s:0:””;s:6:”camera”;s:0:””;s:7:”caption”;s:0:””;s:17:”created_timestamp”;s:1:”0″;s:9:”copyright”;s:0:””;s:12:”focal_length”;s:1:”0″;s:3:”iso”;s:1:”0″;s:13:”shutter_speed”;s:1:”0″;s:5:”title”;s:0:””;}}

    so, at the end i want to delete, this kind of delete chain
    { chain “name image ” chain}, i have this idea

    $var=preg_replace(“(.+)\{(.+)(sopa_nicearma\-15×10\.jpg)(.+)\}/”, “”, $var);

    but dont work fine becouse i have this

    }s:10:”image_meta”;a:10:{s:8:”aperture”;s:1:”0″;s:6:”credit”;s:0:””;s:6:”camera”;s:0:””;s:7:”caption”;s:0:””;s:17:”created_timestamp”;s:1:”0″;s:9:”copyright”;s:0:””;s:12:”focal_length”;s:1:”0″;s:3:”iso”;s:1:”0″;s:13:”shutter_speed”;s:1:”0″;s:5:”title”;s:0:””;}}

  • The topic ‘Need help with regular expre’ is closed to new replies.