Aide Expression Regulieres

thieg -  
kilian Messages postés 8854 Statut Modérateur -
ello Guys,

Trying to analyse my web site stats, I tried to exclude from the
analysis all the URL that contain fr/ or de/

(Exemple: www.mysite.com/fr/home.php or www.mysite.com/de/home.php).

RegExp are not my favorite topic and I couldn't manage to create a
correct expression to exclude such directories.
Any help would be appreciated!

Thanks folks.

Thiegau
A voir également:

1 réponse

kilian Messages postés 8854 Statut Modérateur 1 526
 
Hello,

You can use the function "ereg()" which tests the presence of a RegExp. I think the simple expression "fr" would be a good test. For example, if you take the url "www.mysite.com/fr/home.php":
<?

$url="http://www.mysite.com/fr/home.php";

if (ereg("fr",$url))
{
	echo "It's the french language's directory of you server";
}

?>

Bonne chance ;-)

Li4uLlZvdHJlIGTpdm916SBzZXJ2aXRldXIuLi4u
0