I want to find,using lua features,char $,only if before it no char . For this i create regex ([^\]?)%$,but it ignore the first part of my regex and find only %$,so help me please solve my problem. I create this topic in this site,instead of stackoverflow.com,because may be it problem only in lualatex? Yes,i know,what in lua very bad pattern parser,but i hope,i can find $,only,if it the first char of line or only if before it is char,not equals . Thanks everybody very much for the help.