Adding tags in html file and replacing them while reading from SD


I've seen several examples of webservers with an Arduino and an Ethernet shield. Also reading the webpages from the SD card itself.

But I would like to know how i could add a code that detects if there is a specific tag in the webpage, shuch as: $1 or $2 and substitute them with sensor data?

Could someone give me some pointers?

thank you