I am looking for a way to use Regex to replace a string like this:
The quick #[brown]brown#[clear] fox jumped over the lazy dog.
with
The quick <a style="color:#3B170B">brown<a style="color:#FFFFFF"> fox jumped over the lazy dog.
However the color code is picked out of a like as such
color_list = dict(
brown = "#3B170B",
.....
clear = "#FFFFFF",
)
re.sub()
however I cannot to my knowledge usere.group()
to pull out the partiular name of the color I want. – Blackninja543 Dec 4 '12 at 15:24</a>
closing tag... – Jakub M. Dec 4 '12 at 15:26