slight adjustment to the permission preg_replace method

Change-Id: Ia7fd2d515533f1046b104d69e74065b335691c1e