Forum Moderators: coopster

Message Too Old, No Replies

regex to include special symbols and foreign language characters

unable to read foreign language characters and special symbols

         

phparion

4:22 am on Dec 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi

I am using the following regex to pull out all the information from a html source code,

preg_match_all("/(\/students\/[-\w]+\/[\d]+\/)/",$rawHtml,$stds);

It works fine but whenever there is a special symbol, which is displayed by pressing ALT and some numbers, or some foreign language characters; this code fails to read that. I will be delighted if anyone could guide me what to add to this regex to enable it to read the special symbols and foreign language characters?

thank you very much

PHP_Chimp

1:51 pm on Dec 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The u modifier turns UTF-8 mode on. So would putting the string through as UTF-8 stop the problems with 'strange' characters?