new version for lua pattern