A staple of any regex flavor. For the enhanced patterns (issue #9), this could simply be a flag passed as a separate argument that changes the meaning of ^ and $. But it could be implemented for the basic functions as well, if an appropriate letter code can be chosen.
Unfortunately, many letters are already taken by PUC Lua: a, b, c, d, f, g, l, p, s, u, w, x, and z. That's half the alphabet in use by stock patterns alone, not to mention that named captures (issue #14) have taken k. So we're running low on letters and numbers are not an option (backreferences). Also, I'm guaranteeing that all patterns written for stock Lua will remain compatible with the basic functions in this library as long as they do not rely on undefined behavior, and the 5.3 manual specifies that non-magic characters match themselves literally whether escaped or not, so new punctuation characters cannot be used even with an escape. So I may have to relegate this to enhanced patterns only.
A staple of any regex flavor. For the enhanced patterns (issue #9), this could simply be a flag passed as a separate argument that changes the meaning of
^and$. But it could be implemented for the basic functions as well, if an appropriate letter code can be chosen.Unfortunately, many letters are already taken by PUC Lua:
a,b,c,d,f,g,l,p,s,u,w,x, andz. That's half the alphabet in use by stock patterns alone, not to mention that named captures (issue #14) have takenk. So we're running low on letters and numbers are not an option (backreferences). Also, I'm guaranteeing that all patterns written for stock Lua will remain compatible with the basic functions in this library as long as they do not rely on undefined behavior, and the 5.3 manual specifies that non-magic characters match themselves literally whether escaped or not, so new punctuation characters cannot be used even with an escape. So I may have to relegate this to enhanced patterns only.