Re: Regex Help
| From: | Marek Kilimajer | Date: | Wed, 30 Oct 2002 12:16:49 +0000 |
| Subject: | Re: Regex Help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122008@lists.php.net to get a copy of this message | ||
Instead of splitting the string on chars that don't equal \w and ', split it on chars that equal \s (or any other you need)
Gerard Samuel wrote:
Im trying to explode a string into an array of words using -> $title = preg_split('/[^\w\']/', $title, -1, PREG_SPLIT_NO_EMPTY ); It seems to work well with words like "this" and "don't" but it doens't work with words with accents to it like "Guantánamo" Could my regex be expanded to handle non-english type characters, or any workarounds to get a string into an array of words, where the string contains non english characters?? Thanks