AnsweredAssumed Answered

Creating SEO-Friendly URL's

Question asked by ccrumley on Feb 21, 2012
Latest reply on Feb 21, 2012 by ccrumley

Title

Creating SEO-Friendly URL's

Post

 

We are currently using this function to clean a string and make it ready for use as an SEO-friendly URL

It replaces spaces, parentheses, commas, semicolons, single quotes, double quotes, %'s, spaces and equals signs with hyphens. i'm sure this can be cleaned up- but i'm not familiar with regex as it works in FM...

Substitute (description ; ["/" ; "-"] ; [" " ; "-"] ; ["&" ; "-"] ;["@ " ; "-"] ;["'" ; "-"] ;["\" " ; "-inch-"] ;["(" ; "-"] ; [")" ; "-"] ;["%" ; "-"] ;["," ; "-"];["#" ; "-"];[";" ; "-"];["=" ; "-"])

we keep getting unexpected results with some spaces and quotes not being replaced - can anyone see room for improvement?

Outcomes