diff --git a/ecrire/public/criteres.php b/ecrire/public/criteres.php
index 1a646088202f3b6f5bd37831c3c6887dc206ba81..9e8ceb08d9b45a9559129056664d8a078df14ef1 100644
--- a/ecrire/public/criteres.php
+++ b/ecrire/public/criteres.php
@@ -338,7 +338,7 @@ function critere_parinverse($idb, &$boucles, $crit, $sens) {
 		  $boucle->select[] = $texte . " AS $as";
 		  $order = "'$as'";
 	      } else {
-	      if (!ereg("^" . CHAMP_SQL_PLUS_FONC . '$', $par, $match)) 
+	      if (!preg_match(",^" . CHAMP_SQL_PLUS_FONC . '$,is', $par, $match)) 
 		erreur_squelette(_T('zbug_info_erreur_squelette'), "{par $par} BOUCLE$idb");
 	      else {
 		if ($match[2]) { $par = substr($match[2],1,-1); $fct = $match[1]; }