[thelist] regex

Algian algian at algian.com
Sat Sep 2 16:13:22 CDT 2000


>For example, I have this string:
>$names = "Ab Station<br>  Deutschland (Osten), England";
>(yupp, exactly this thingy...)
>
>Now I want to substitute each of these German names with their
>translation.


had the same problem with a list of countries as well
if something like "South Africa" was chosen it would
count it in the array as South and as Africa... so I just added
undersocres in the spaces "_"
For the translation file you can have the Key value for your hash
not contain anymore spaces and replace those spaces with underscores
aswell...

so when you do: 

$translation{$_}

you are actually not looking for eg South and Africa but for South_Africa
and the Key will be also South_Africa...

I hope i wasn't too confusing...:)





More information about the thelist mailing list