[TYPO3-core] RFC #9994: Bug: ereg_replace is deprecated in PHP 5.3 alpha3

Martin Kutschker masi-no at spam-typo3.org
Tue Dec 30 17:54:40 CET 2008


Niels Pardon schrieb:
> Hi Olly!
> 
> Oliver Hader schrieb:
>> There's one difference between [:alnum:] and \w:
>> * [:alnum:] is 0..9, A..Z, a..z
>> * \w is 0..9, A..Z, a..z and _ (underscore)
> 
> You're right. [:alnum:] does not contain the underscore whereas \w does.
> 
> I was not sure whether a character class [A-Za-z0-9] would be a good
> replacement as [:alnum:] can contain language specific characters
> (depending on the locale) which are included in \w, too.

I think that there was probably in very few cases the intention to match
accented characters. So [A-Za-z0-9] is more correct. But this has to be
checked on a per case basis.

Masi


More information about the TYPO3-team-core mailing list