I'll say it would be far better to implement your own "assertTag" to avoid rewrite the same unreadable regex pattern over and over. Or to look if the testing framework provides a replacement or a prefered way to replace those.

Le lundi 18 août 2014, Thiemo Mättig <thiemo.maettig@wikimedia.de> a écrit :
Let's say I'm testing a method that returns a small HTML snippet. In your opinion, is it ok if I replace assertTag with one or more 1-line regular expressions? (Focus on readability, each regular expression should only test one aspect.)