title: Token replacement
body: <p>I currently implement a replace function in the page render method which replaces commonly used strings - such as replace [cfe] with the root to the customer front end. This is because the value may be different based on the version of the site - for example the root to the image folder <code>([imagepath])</code> is <code>/Images</code> on development and live, but <code>/Test/Images</code> on test.</p>
  
  <p>I have a catalogue of products for which I would like to change <code>[productName]</code> to a link to the catalogue page for that product. I would like to go through the entire page and replace all instances of <code>[someValue]</code> with the relevant link. Currently I do this by looping through all the products in the product database and replacing <code>[productName]</code> with the link to the catalog page for that product. However this is limited to products which exist in the database. "Links" to products which have been removed currently wont be replaced, so <code>[someValue]</code> will be displayed to the user. This does not look good.</p>
  
  <p>So you should be able to see my problem from this. Does anyone know of a way to achieve what I would like to easily? I could use regexes, but I don't have much experience of those. If this is the easiest way, using "<code>For Each Match As String In Regex.Matches(blah, blah)</code>" then I am willing to look further into this.</p>
  
  <p>However at some point I would like to take this further - for example setting page layouts such as 3 columns with an image top right using <code>[layout type="3colImageTopRight" imageURL="imageURL"]Content here[/layout]</code>. I think I could kind of do this now, but I cant figure out how to deal with this if the <code>imageURL</code> were, say, <code>[Image:Product01.gif]</code> (using <code>regex.match("[[a-zA-Z]{0,}]")</code> I think would match just <code>[layout type="3colImageTopRight" imageURL="[Image:Product01.gif]</code> (it would not get to the end of the layout tag). Obviously the above wouldn't quite work, as I haven't included double quotes in the match string or anything, but you get the general idea. You should be able to get the general idea of what I am getting at and what I am trying to do though.</p>
  
  <p>Does anyone have any ideas or pointers which could help me with this? Also if this is not strictly token replacement then please point me to what it is, so I can further develop this.</p>
  
  <p>Aristos - hope reexplaining this resolves the confusion.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Regards,</p>
  
  <p>Richard Clarke</p>