Improve regex for getting appid