var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: MYSQL REGEXP REPLACE - Proving very difficult...
So - I have the following problem - here's my query:
CONCAT('C-', `idcategories`, '-', LOWER(REPLACE(categoryname, categoryname REGEXP '[^a-zA-Z0-9]', '-')), '.html')
This partially works, I get the following results:
But there is a problem. My regexp does not seem to be working.
C-10-amplifiers & receivers.html
Could anyone please help?
Is there a reason this does not work, because it looks correct and kind of works!
P.S. I am trying to strip out all none-alpha-numeric chars and replace them with a hyphen "-".
Last edited by avera; 04-13-09 at 15:33.
Just a heads up - I cannot reverse the query because there is no WHERE clause.
(Someone asked me that on anoither forum.)
REGEXP can only return "yes" or "no" whether it finds a match
you will have to replace the unwanted characters individually (nested REPLACE functions)
Yeah - I noticed that it returns 1 or 0.
But I would have imagined that would have given the REPLACE some indication of a match.
Any other ideas?
yes -- use two columns instead of one, and use your application language (php?) to store the two different strings
Originally Posted by avera