Re: Removing UTF-8 from text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dotan Cohen wrote:
On 03/01/07, Richard Lynch <ceo@xxxxxxxxx> wrote:
Instead of trying to strip the UTF stuff out, try to capture the part
you want:

preg_match_all('|<[^>]>|ms', $emails, $output);
var_dump($output);


Richard, I do have a working script now, but I'm intrigued by your
regex. Why do you surround the needle with pipes, and what is the "ms"
for?

http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php lists what the modifiers do.

As others have mentioned, you can use anything as delimiters. Sometimes it's easier to change the delimiter rather than worrying about escaping it - for example when doing a regex for urls.. so instead of:

/http:\/\/ etc etc / (hard to read)

change the delimiters:

#http:// etc etc #

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux