I’ve written the small library `re-template-tag` that provides a template tag function for composing regular expressions. This blog post explains how it works.
P. Pantel, and M. Pennacchiotti. Ontology Learning and Population: Bridging the Gap between Text and Knowledge, volume 167 of Frontiers in Artificial Intelligence and Applications, IOS Press, (2008)
Y. Li, R. Krishnamurthy, S. Raghavan, S. Vaithyanathan, and H. Jagadish. Proceedings of the 2008 Conference on Empirical Methods in Natural Language Processing, page 21--30. Honolulu, Hawaii, Association for Computational Linguistics, (October 2008)