[TYPO3-core] RFC: Small change to class.t3lib_install.php - eregi to preg_match

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Jun 27 23:11:10 CEST 2006


Karsten Dambekalns schrieb am 27.06.2006 21:33:

> The attached diff changes an eregi() call to a matching preg_match() call.
>
> (...)
> -			if (eregi('^insert[[:space:]]*into[[:space:]]*[`]?([[:alnum:]_]*)[`]?',substr($linecontent,0,100),$reg))	{
> +			if (preg_match('/^insert[[:space:]]*into[[:space:]]*[`]?([[:alnum:]_]*)[`]?/i',substr($linecontent,0,100),$reg))	{

Are you sure [[:space:]] and [[:alnum:]] are available in the PCRE
environment? They are not documented in [1], as far as I can see. Maybe
they could be changed with

  \s = space
  \w = word (letter, digit or underscore)


[1] http://de.php.net/manual/en/reference.pcre.pattern.syntax.php

Cheers,
Ernesto



More information about the TYPO3-team-core mailing list