Mailing List Archive


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

Re: [tlug] Do you whitelist or blacklist utf-8?



On 23 February 2011 16:42, Dave M G <dave@example.com> wrote:

> So, I suck at regex, but maybe I want to do something like this:
>
> ^\p{L}\p{N}\p{Z}$

^[\p{L}\p{N}\p{Z}]$

This is assuming that PHP's regex engine can handle the POSIX attributes.

> ... and then black list the space characters I don't like:
>
> ^\n\r\t$

I'd just replace them with acceptable whitespace:

s/[\n\r\t]/ /g

Or strip them:

s/[\n\r\t]//g

-- 
Cheers,
Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links