[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Proposal for lpeg
- From: albertmcchan <albertmcchan@...>
- Date: Wed, 7 Feb 2018 17:49:37 -0500
to make re.anywhere more convenient, i added = prefix in re.lua for anywhere search
this produce very readable lpeg re pattern
t = 'this and that and whatever'
-- search for end position of that
= re.match(t, "= 'that'")
14
-- search for start and end of 'that'
= re.match(t, "=({} 'that' {})")
10 14
-- lua pattern ".*and(.*)"
= re.match(t, "(= 'and')+ {.*}")
whatever