Andy Pieters wrote:
>
> Err.. why NOT use character classes? What is easier [0-9] or \d or maybe
> [a-zA-Z] or [\w], ... ?
>
Well, first of all the square brackets in [\w] aren't needed, \w already
means 'any "word" character'.
Secondly, [a-zA-Z] is not the same as \w:
" A "word" character i
Andy Pieters wrote:
> Hi list
>
> I still fail to understand why regular expressions are causing me such a hard
> time.
>
>
Hi!
Why don't you use 'preg_match'? And why do you use all those character
classes?
This:
$subject = 'Nov 22 06:51:36';
$pattern = '/^(\w{3})\s(\d{2}
twistednetadmin wrote:
> Thanks guys. That helps alot!
>
> But this:
> print $_SERVER['HTTP_USER_AGENT'];
> ?>
>
> Returned this using Mozilla: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
> rv:1.7.12) Gecko/20050915 Firefox/1.0.7
> And this using IE: Mozilla/4.0 (compatible; MSIE 6.0; Window
3 matches
Mail list logo