Slightly off-topic, that code is really ugly. First because you shouldn't use regexes to parse XML. Second, the s and i modifiers on the regex aren't doing anything. Third, the use of e is really unnecessary. You could probably rewrite that line like this (untested):