I have a problem with preg_match
$versionstring[1] = 'Version: ImageMagick 6.4.6 2010-01-20 Q8 OpenMP http://www.imagemagick.org Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC';
preg_match('#^Version: [^0-9]*([ 0-9\\.\\:Q/\\-]+) (http|file)\:#i', $versionstring[1], $matches))
returns false
how can i fix this ?
OpenMP was added to the ImageMagic version string since your regex was working, so as a quick fix, you can just add OpenMP like this:
But just be aware that this could happen again on future upgrades, so depending on what you're using this for, you think about making the regex less string specific and just pull out the information you need.