MySQL Regex or Split

Nicholas Leippe nick at
Wed Apr 27 12:26:18 MDT 2005

On Wednesday 27 April 2005 11:02 am, Eric Jensen wrote:
> Trying to make some queries a little more efficient.  I want to group
> HTTP referers together but not with the full URL.  For example, just
> "" instead of the full search string.  I can't find a way
> to do this in MySQL.  Is there a way to turn
> "" into
> "" in a SELECT statement?  Otherwise I have to loop
> through them all and parse them myself and run more queries then necessary.

You can probably get by using substring(), locate(), and a little bit of 

If you need absolute speed, consider writing a udf--it's really not hard to 


Nicholas Leippe
Sales Team Automation, LLC
1335 West 1650 North, Suite C
Springville, UT  84663 +1 801.853.4090

More information about the PLUG mailing list