Re: [PHP] regex - filtering out chinese utf8 characters

2009-07-30 Thread Jim Lucas
Merlin Morgenstern wrote: > Hi there, > > I am trying to filter out content that is not ascii. Can I do this with > regex? For example: > > $regex = '[AZ][09]'; > if (preg_match($regex, $text)) { > return TRUE; > } > else { > return FALSE; > } > > The reason I

Re: [PHP] regex - filtering out chinese utf8 characters

2009-07-30 Thread Daniel Kolbo
Merlin Morgenstern wrote: > Hi there, > > I am trying to filter out content that is not ascii. Can I do this with > regex? For example: > > $regex = '[AZ][09]'; > if (preg_match($regex, $text)) { > return TRUE; > } > else { > return FALSE; > } > > The reason I

Re: [PHP] regex - filtering out chinese utf8 characters

2009-07-30 Thread Stuart Connolly
Hi Merlin, I think the pattern you're looking for is '/[a-zA-Z0-9]/' which will match all alphanumeric characters. Cheers Stuart On 30 Jul 2009, at 19:13, Merlin Morgenstern wrote: Hi there, I am trying to filter out content that is not ascii. Can I do this with regex? For example:

[PHP] regex - filtering out chinese utf8 characters

2009-07-30 Thread Merlin Morgenstern
Hi there, I am trying to filter out content that is not ascii. Can I do this with regex? For example: $regex = '[AZ][09]'; if (preg_match($regex, $text)) { return TRUE; } else { return FALSE; } The reason I need to do thi