It is so much better idea to use meta-programming to solve this problem – https://github.com/excilys/androidannotations/wiki/Injecting...
Ironically, my most recent use of regexps has been finding such boilerplate and simplifying it by using newer, cleaner APIs so I can remove the old terrible ones. Let Regexes Delete that code for you.