Xerratus
Happily stressed out, since 1974


 
Wednesday, October 26, 2005
<< New perspective on living
PSA: Don't use a stolen credit card to purchase a lottery ticket >>

When I blog, there's a good chance that I'll want to, or have to in some cases, make an update to that entry.  When I do, I like to call out the update so that the average reader knows.  Some examples:

Gorilla to scientist, I'll roshambo you for that banana
Yeah, just try and remove something from Google
Kingston 512MB PC2100 RAM

Now, when I do this, I have to select my font color and bold "update:"; basically give it the exact look and feel each and every time.  Being a programmer, I like to simplify my life by creating a method to keep me from having to duplicate my efforts each time.  With that, I've created a simple content filter that will render my updates the same time, every time.  Just add the following in the content filters section of dasBlog

note: You may want to change the look and feel unless you like my burnt orange color scheme.

\$update\((?<expr>[\w\s\d\W\D]+)\)

<font color="#cc6600"><b>UPDATE: </b>${expr}</font>

The only difference that sets this apart from some of the built in content filters is \W\D regular expression filters; these simply allow non-digit and non-alphanumeric characters thru.

\D  # NOT a digit
\W  # NOT an alphanumeric (word) character

Now, there are changes that can be made to the above such as changing $update to $u for simplicity.  You could also change so that it uses <span>'s with css classes for better control of future color scheme changes, which I highly recommend.

UPDATE: This is what an update to this entry looks like using the $update content filter.

Enjoy.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview