8585 )
8686 set (PHP_VERSION "${PHP_VERSION_FALLBACK} " )
8787 else ()
88- string (REGEX MATCH [[php-([0-9]+.[0-9]+.[0-9]+) .tar.gz]] _ "${filename} " )
88+ string (REGEX MATCH [[php-([0-9.]+)\ .tar\ .gz]] _ "${filename} " )
8989 set (PHP_VERSION "${CMAKE_MATCH_1} " )
9090 endif ()
9191 endblock()
@@ -207,7 +207,7 @@ function(php_download)
207207 "https://github.com/php/php-src/archive/refs/heads/${branch} .tar.gz"
208208 )
209209 elseif (PHP_VERSION MATCHES "^.*-dev$" )
210- string (REGEX MATCH [[(^[0-9]+)\.([0-9]+).*$ ]] _ "${PHP_VERSION} " )
210+ string (REGEX MATCH [[(^[0-9]+)\.([0-9]+)]] _ "${PHP_VERSION} " )
211211 set (branch "PHP-${CMAKE_MATCH_1} .${CMAKE_MATCH_2} " )
212212
213213 list (
@@ -296,7 +296,7 @@ function(php_prepare_sources)
296296 message (STATUS "Applying patches to ${PHP_SOURCE_DIR_RELATIVE} " )
297297
298298 # Apply patches for php-src.
299- string (REGEX MATCH [[([0-9]+\.[0-9]+).*$ ]] _ "${PHP_VERSION} " )
299+ string (REGEX MATCH [[^ ([0-9]+\.[0-9]+)]] _ "${PHP_VERSION} " )
300300 file (GLOB_RECURSE patches ${PHP_ROOT_DIR} /patches/${CMAKE_MATCH_1} /*.patch)
301301
302302 foreach (patch ${patches} )
@@ -318,7 +318,7 @@ function(php_prepare_sources)
318318
319319 # Clean temporary .git directory. Checks are done as safeguards.
320320 if (
321- PHP_SOURCE_DIR MATCHES " \\ /php-8\\ .[0-9][.-].*$"
321+ PHP_SOURCE_DIR MATCHES [[ /php-8\.[0-9][.-].*$]]
322322 AND IS_DIRECTORY ${PHP_SOURCE_DIR} /.git/
323323 AND EXISTS ${PHP_SOURCE_DIR} /php.ini-development
324324 AND EXISTS ${PHP_SOURCE_DIR} /main/php_version.h
0 commit comments