[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: pattern matching in require, and ellipses ?
- From: Jayanth Acharya <jayachar88@...>
- Date: Thu, 10 Mar 2011 20:41:13 +0530
Probably as a result of adopting a leap-frogging (instead of a thorough) approach to learning Lua, am not quite able to figure out what this segment of code does/means, and a google search didn't yeild much.
local struct = require(_NAME:match("^[^%.]+"))
local name = (...):gsub('%.[^%.]+$', '')
This is from the vstruct basic.lua example. What does the _NAME:match() do ? What does "(...):gsub(pattern...)" do ?