[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: LPEG - equivalent of {m,n} operator
- From: "Paul Moore" <p.f.moore@...>
- Date: Sat, 29 Nov 2008 19:03:24 +0000
In (some versions) of regular expression syntax, the construct x{m,n}
matches between m and n copies of the pattern x. So, for example,
\d{3,5} matches 3-5 digits. However, I can't find a precise equivalent
in lpeg - it appears that the only way is to repeat the pattern m
times, then add ( the pattern ^ - (n-m) ). Is that the case?
Paul.