Improve regex for license script