Description
http://doc.trolltech.com/4.7/qscriptengine.html#newRegExp-2
The fact that the flags argument is a string is a result of adopting the same quirk as the JS RegExp constructor.
The flags really should be flags.
Then we also avoid having to deal with the silly case where the string contains invalid or duplicate characters (in which case the ES spec says an exception should be thrown, but not all implementations do that...).