I am attempting to do statistical tracking. In my database I am storing referring urls. Frequently I have url's that resemble the following:
http://www2.trafficadbar.com/__a4w4
http://trafficadbar.com/__a4w4
http://www.trafficadbar.com/__a4w4
http://4acesmailer.com/credit_click.php?userid=2472&openkey=gbyp2vcm
http://4acesmailer.com/credit_click.php?userid=2714&openkey=gbyp2vcm
http://4acesmailer.com/credit_click.php?userid=2723&openkey=gbyp2vcm
http://4acesmailer.com/credit_click.php?userid=3245&openkey=gbyp2vcm
http://4acesmailer.com/credit_click.php?userid=3259&openkey=gbyp2vcm
I want to know how I would do a GROUP BY and COUNT on a regex pattern. Basically what I want is as follows returned:
trafficadbar 3
4acesmailer 5
Currently when I try to do a GROUP BY it only works where the url's are exactly the same. so www.blah.com and blah.com are two different results and further each url variable ?blah=1&blahblah=2 acts as yet anoher unique group,
I have searched for countless solutions, but they mostly seem to be very specific to the problem asked, and almost all seem to show some "non-regex" workaround - which would be fine... if I could find a method I could apply.