Just to add a (hopefully useful) Code Sample to support Chris And Nuno's answer about post processing it in C#. It is partially pseudo code. I am very bad at RegEx, so this you need to figure out. Also in the ReplaceUrls() Method you need to add whatever it is you want based on certain code between the {}:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using Tridion.ContentManager.Templating;
using Tridion.ContentManager.Templating.Assembly;
using Tridion.ContentManager.ContentManagement;
using Tridion.ContentManager.ContentManagement.Fields;
namespace TBB.Templates
{
public class ReplaceString : TemplateBase
{
private static readonly Regex tcmReference = new Regex(@"{tcm:mytcm})", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Singleline | RegexOptions.Compiled);
private string _outputContent;
public override void Transform(Engine engine, Package package)
{
this.Initialize(engine, package);
Page page = this.GetPage();
this._outputContent = package.GetByType(new ContentType("text/html")).GetAsString();
ReplaceUrls();
package.GetByType(new ContentType("text/html")).SetAsString(this._outputContent);
}
private void ReplaceUrls()
{
string[] textContainer = new string[] { this._outputContent };
foreach (Match match in TemplateUtilities.GetRegexMatches(textContainer, tcmReference))
{
Group group = match.Groups["url"];
if (group.Value.Contains("specific"))
{
this._outputContent = this._outputContent.Replace("specificParam", "SnippetCode");
}
}
}
}
}