As I mentioned yesterday, Lua's `string` namespace implements a simplified regex variant. So how'd we implement it (in Lua) upon the Scanner we bootstrapped a Lua lexer upon?
Use 2 Scanners: 1 for the "pattern" we're interpreting, & another for the "haystack" string we're testing.
To start I'd capture all pattern-chars until "%" (amongst others) & see if it matches the corresponding substring of the haystack.
Typically the next letter represents range(s) to test the haystack-char against.
1/3
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.