fixed regexp for php and js