first version not tested
must use phantomjs style js
fix regexp