In JavaScript the only way I'm aware of is using the ? modifier.
Then why don't you use it?
Simply because it does not work in QtScript.


I will try exporting QRegExp. I hope it won't requite more exports, since these scripts are meant to be an easy interface for users. They should be able to use it just like JavaScript without reading tons of additional documentation.