lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


  Find a pattern with no captures such that putting it in parentheses
  may change what it matches.

More precisely:

   Find strings `str` and `pat` such that `testanswer(str,pat)` prints
   'true', where

testanswer = function(str,pat)
if pat:match"[()]" then return end
print(str:match(pat) ~= str:match('(' .. pat .. ')'))
end