« MySQL/Regex » : différence entre les versions

Contenu supprimé Contenu ajouté
mAucun résumé des modifications
Ligne 45 :
Fonctionne comme la fonction REPLACE() mais avec du regex. Exemple pour retirer les caractères spéciaux d'une chaine :
<syntaxhighlight lang="mysql">
select REGEXP_REPLACE('hello+$ù^:world', '[^a-z]', '');
-- helloworld
</syntaxhighlight>
 
Ligne 51 ⟶ 52 :
Extrait une sous-chaine (''substring''). Ex :
<syntaxhighlight lang="mysql">
SELECT REGEXP_REPLACE(REGEXP_REPLACE('<html><title>Page 1</title>...</html>', '.*<title>', ''), '</title>.*', '');
-- Page 1
</syntaxhighlight>