Hey everyone, I have a little preg_match problem that I can't seem to solve, I'm pretty new to php and programming, and haven't got my head round regular expressions yet! What I have is this: preg_match("'q=(.*?)(&| )'si", " $url ", $keywords); I am using it to match/extract the q= parameter (search term) from the referrer when a surfer clicks from google. The problem is that google also occasionally has a aq= parameter which is usually set to aq=t. In these cases the search term is logged as t rather than the actual term. I know that I need to basically check for ?q= or &q= to make sure the parameter is just q= but I can't work out how I fit that into my expression above. Any help would be greatly appreciated. Thanks