|
Posted by Rik on 01/28/07 23:34
Curtis <dyer85@gmail.com> wrote:
> On Jan 27, 5:56 am, Rik <luiheidsgoe...@hotmail.com> wrote:
>> Geoff Berrow <blthe...@ckdog.co.uk> wrote:
>> > Message-ID: <op.tmtehzlvqnv...@misant.kabel.utwente.nl> from Rik
>> > contained the following:
>>
>> >> The way I usually handle it:
>> >> - I'll have a very retrictive character set for the username (usually
>> >> something like [a-zA-Z0-9_\s]+).
>>
>> > That's the thing I was looking for. And how would I use that with
>> > preg_match? Just can't get my head round regex syntax, sorry.
>>
>> Hmmz, correction, I seem to use [a-zA-Z0-9_-]
>>
>
> This is also fairly restrictive, but allows spaces (as opposed to
> allowing tabs or newlines): [\w -]
> Note: \w is the same as [a-zA-Z0-9_]
I'd allow underscores also, so [\w _-].
I usually don't use the \w so I can recognize valid characters somewhat
easier, but it works OK offcourse.
--
Rik Wasmus
Navigation:
[Reply to this message]
|