How could I replace all the commas with "commas followed by a space" only within the keywords meta tag ? (using dreamweaver's regular expressions)
Turn this:
<meta name="Keywords" content="word1,word2,word3,word4,word5,word6" />
into this:
<meta name="Keywords" content="word1, word2, word3, word4, word5, word6" />
I've tried many combinations but couldn't find answer:
"Keywords" content="[,]/>$
search and replace with regular expressions
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I'm not sure how complex you can make the expression(s) or code, but in Javascript (as well as PHP) what I do is write an expression to find the whole tag I want to manipulate first. I then iterate those results finding all "content" attributes. It's a simple replace call after that and some join method calls, typically.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm