VE Lua Documentation

Press F to search!

gmatch

Definition


-- @/=[C]:-1
function gmatch(...)

Callers

@/lua/ge/extensions/tech/capturePlayer.lua
  if dirname == nil then dirname = '' end
  baseFilename = baseFilename:gmatch("([^%.]+)")()
  local outputFilename = dirname .. '/' .. baseFilename .. '.log'
@/lua/common/jit/p.lua
  local m = {}
  for c in mode:gmatch(".") do m[c] = c end
  prof_states = m.z or m.v
@/lua/ge/extensions/editor/forestEditor.lua
  local i = 1
  for str in string.gmatch(getMissionFilename(),"([^/]+)") do
    if i == 2 then
@/lua/ge/extensions/editor/dynamicDecalsTool.lua
  local file = ""
  for word in str:gmatch("%w+") do
    file = word
@/lua/common/json-ast.lua
  local lines = {}
  for line in str:gmatch("([^\n]*)\n?") do
    table.insert(lines, line)
@/lua/ge/extensions/career/branches.lua
  local folders = {'domains'}
  for folder in string.gmatch(string.sub(infoDir, #branchesDir, -2), "[^/]+") do
      table.insert(folders, folder)
  local folders = {'domains'}
  for folder in string.gmatch(string.sub(infoDir, #branchesDir, -2), "[^/]+") do
      table.insert(folders, folder)
@/lua/common/json.lua
  local n = 1
  for w in s:gmatch("([^\n]*)") do
    curlen = curlen + #w
@/lua/ge/extensions/gameplay/rally/util/jsonlUtils.lua
  local lines = {}
  for line in content:gmatch("[^\r\n]+") do
    table.insert(lines, line)
@/lua/ge/extensions/editor/roadUtils.lua
  local decorationIDs = road:getField("decorationIDs", "")
  for decoID in string.gmatch(decorationIDs, "%d+") do
    local object = scenetree.findObjectById(tonumber(decoID))
  local decalIDs = road:getField("decalIDs", "")
  for decalID in string.gmatch(decalIDs, "%d+") do
    editor.deleteRoad(tonumber(decalID))
  local childIDs = road:getField("childRoads", "")
  for childID in string.gmatch(childIDs, "%d+") do
    editor.deleteRoad(tonumber(childID))
@/lua/common/libs/LuaIRC/asyncoperations.lua
    -- Split the message into segments if it includes newlines.
    for line in msg:gmatch("([^\r\n]+)") do
        self:send("PRIVMSG %s :%s", verify(target, 3), line)
    -- Split the message into segments if it includes newlines.
    for line in msg:gmatch("([^\r\n]+)") do
        self:send("NOTICE %s :%s", verify(target, 3), line)
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
    local path = {}
    for str in string.gmatch(string.sub(fileWithoutExtension, 1, string.len(fileWithoutExtension) - 2), "([^'/']+)") do
      table.insert( path, str )
        local path = {}
        for str in string.gmatch(string.sub(fileWithoutExtension, 1, string.len(fileWithoutExtension) - 6), "([^'/']+)") do
          table.insert( path, str )
  local i = 1
  for str in string.gmatch(color, "([^' ']+)") do
    t[i] = tonumber(str)
@/lua/ge/extensions/editor/particleEditor.lua
  local particleNames = {}
  for s in fieldValue:gmatch("[^\t]+") do
    table.insert(particleNames, s)
@/lua/ge/extensions/core/input/bindings.lua
      local responseCurve = {}
      for line in f:gmatch("([^\n\r]*)") do
        if line ~= "" then
          local column = 0
          for field in line:gmatch("([^,|]*)") do
            field = field:match("^%s*(.-)%s*$")
@/lua/ge/extensions/editor/undoHistory.lua
  local lines = {}
  for s in actionData:gmatch("[^\n]+") do
    table.insert(lines, s:sub(1, toolTipMaxWidth)) -- limit width
@/lua/ge/extensions/editor/audioEventsList.lua

  for dir in string.gmatch(path, pattern) do
    table.insert(pathSplit, dir)
@/lua/common/libs/LuaIRC/handlers.lua
        local users = o.channels[channel].users
        for nick in names:gmatch("(%S+)") do
            local access, name = parseNick(nick)
        local optList = {...}
        for c in modes:gmatch(".") do
            if     c == "+" then add = true
@/lua/ge/extensions/editor/visualization.lua
    local filterTokens = {}
    for token in string.gmatch(filterQuery, "[%w_]+") do  -- split
      table.insert(filterTokens, string.lower(token))     -- lower case
@/lua/ge/extensions/flowgraph/nodes/ui/vehicleSelector.lua
      if self._selectedVehData.color then
        for substring in self._selectedVehData.color:gmatch("%S+") do
           table.insert(self.pinOut.color.value, substring)
@/lua/common/utils/httpJsonServer.lua
    -- process URI's in that
    for uri in string.gmatch(line, "GET /([^ ]*) HTTP/[0-9].[0-9]") do
        local headers = {}
@/lua/ge/extensions/career/modules/partInventory.lua
  local segments = {}
  for segment in string.gmatch(path, "[^/]+") do
    table.insert(segments, segment)
@/lua/ge/extensions/editor/veMain.lua
  -- e.g. "foo/bar/baz" -> {"foo", "bar", "baz"}
  for p in string.gmatch(str, "%s*%a+[%s%a+]*") do
    table.insert(list, p)
@/lua/ge/extensions/editor/missionEditor.lua
  local keys = {}
  for x in header:gmatch("([^',']+)") do table.insert(keys, x) end
  dump(keys)
    local values, idx = {}, 1
    for x in row:gmatch("([^,]+)") do
      dump(x)
@/lua/ge/ge_utils.lua
  local i = 1
  for s in string.gmatch(str, "([^"..sep.."]+)") do
    t[i] = s
  local modulepath = string.gsub(modulename, "%.", "/")
  for path in string.gmatch(package.path, "([^;]+)") do
    local filename = string.gsub(path, "%?", modulepath)
@/lua/vehicle/extensions/profiling/p.lua
  local m = {}
  for c in mode:gmatch(".") do m[c] = c end
  prof_states = m.z or m.v
@/lua/ge/extensions/flowgraph/nodes/util/ghost.lua
  local path = {}
  for k,v in string.gmatch(nodeData.type, "%a+") do
    table.insert(path, k)
@/lua/ge/extensions/flowgraph/nodes/ui/contextTranslation.lua
        self.variablesState = 2
        for v in string.gmatch(translationString, "{{%a+}}") do
          self:createPin('in', 'string', v:sub(3, -3), nil, '')
@/lua/ge/extensions/editor/resourceChecker.lua
    local node = root
    for part in p:gmatch("[^/]+") do
      node.children[part] = node.children[part] or {
@/lua/ge/extensions/editor/assetBrowser.lua
  local i = 1
  for str in string.gmatch(getMissionFilename(),"([^/]+)") do
    if i == 2 then
  local dirNames = {}
  for dirName in string.gmatch(path, "[%w_]+") do
    if not isLevelDir or dirName ~= var.levelName then
  local dirNames = {}
  for dirName in string.gmatch(path, "[%w_]+") do
    if dirName ~= var.levelName then
@/lua/ge/extensions/util/trackBuilder/materialUtil.lua
  local i = 1
  for str in string.gmatch(color, "([^' ']+)") do
    t[i] = tonumber(str)
@/lua/ge/extensions/gameplay/drag/display.lua
  -- Three decimal points for time
  for num in string.gmatch(string.format("%.3f", timeVal), "%d") do
    table.insert(timeDisplayValue, num)
  -- Two decimal points for speed
  for num in string.gmatch(string.format("%.2f", velVal), "%d") do
    table.insert(speedDisplayValue, num)
@/lua/ge/extensions/flowgraph/nodes/mission/UpdateDisplayDragRace.lua
  -- Three decimal points for time
  for num in string.gmatch(string.format("%.3f", finishTime), "%d") do
    table.insert(timeDisplayValue, num)
  -- Two decimal points for speed
  for num in string.gmatch(string.format("%.2f", finishSpeed), "%d") do
    table.insert(speedDisplayValue, num)
@/lua/ge/extensions/tech/techCore.lua
  local result = name
  for match, translationString in name:gmatch('(%{%{\'(.+)\' | translate%}%})') do
    result = result:gsub(match, translateLanguage(translationString, translationString, true))
    if v.levelName == nil then
      _, v.levelName = v.map:gmatch('([^%.]+)')
    end
@/lua/ge/extensions/editor/assemblySpline/molecule.lua
      local parts = {}
      for part in anchorName:gmatch("[^%.]+") do -- Parse the anchor point name into parts.
        parts[#parts + 1] = part
@/lua/common/extensions/ui/improfiler.lua
  local m = {}
  for c in mode:gmatch(".") do m[c] = c end
  prof_states = m.z or m.v
@/lua/ge/extensions/editor/sidewalkSpline/kit.lua
      table.clear(tmpParts) -- Clear the reusable table.
      for part in anchorName:gmatch("[^%.]+") do -- Parse the anchor point name into parts.
        tmpParts[#tmpParts + 1] = part
@/lua/common/libs/lua-websockets/websocket/handshake.lua
  request = request:match('[^\r\n]+\r\n(.*)')
  for line in request:gmatch('[^\r\n]*\r\n') do
    local name,val = line:match('([^%s]+)%s*:%s*([^\r\n]+)')
  if headers['sec-websocket-protocol'] then
    for protocol in headers['sec-websocket-protocol']:gmatch('([^,%s]+)%s?,?') do
      for _,supported in ipairs(protocols) do
@/lua/ge/extensions/freeroam/dragRace.lua
  -- Three decimal points for time
  for num in string.gmatch(string.format("%.3f", finishTime), "%d") do
    table.insert(timeDisplayValue, num)
  -- Two decimal points for speed
  for num in string.gmatch(string.format("%.2f", finishSpeed), "%d") do
    table.insert(speedDisplayValue, num)
@/lua/ge/extensions/editor/dynamicDecals/history.lua
  local lines = {}
  for s in actionData:gmatch("[^\n]+") do
    table.insert(lines, s:sub(1, toolTipMaxWidth)) -- limit width
@/lua/ge/extensions/campaign/campaignsLoader.lua
  local pattern = "([^"..token..".]+)"
  for part in field:gmatch(pattern) do
    table.insert(fieldParts, part)
@/lua/common/extensions/tech/techCapture.lua
  local dirname, baseFilename, extension = path.splitWithoutExt(pathToFile)
  baseFilename = baseFilename:gmatch("([^%.]+)")() -- change file. into file
  if dirname == nil then dirname = '/' end
@/lua/ge/extensions/editor/dynamicDecals/export.lua
      local newVal = ""
      for c in val:gmatch(".") do
        if c == " " then
      local newVal = ""
      for c in val:gmatch(".") do
        if c == " " then
@/lua/ge/extensions/util/sortLines.lua
  local lines = {}
  for line in content:gmatch('([^\n]*)\n?') do
    local obj = jsonDecode(line)
@/lua/ge/extensions/editor/buildingEditor.lua
	local t = {}
	for str in string.gmatch(s, "([^"..d.."]+)") do
		t[#t + 1] = tonumber(str)
@/lua/ge/extensions/career/modules/partShopping.lua
  local segments = {}
  for segment in string.gmatch(path, "[^/]+") do
    table.insert(segments, segment)
      -- Split path into segments and process each one
      for segment in currentPath:gmatch("([^/]+)/") do
        table.insert(pathSegments, slotsNiceName[segment] or segment)
@/lua/common/libs/LuaIRC/util.lua
    local access = {op = false, halfop = false, voice = false}
    for c in accessString:gmatch(".") do
        if     c == "@" then access.op = true
@/lua/common/utils/simpleHttpServer.lua
  -- process URI's in that
  for uri in string.gmatch(line, "GET (/[^ ]*) HTTP/[0-9].[0-9]") do
    local headers = {}
@/lua/ge/extensions/editor/gen/world.lua
	local apos = {}
	for c in tb:getField('position',0):gmatch("%S+") do
		apos[#apos+1] = tonumber(c)
				local spart = ''
				for part in string.gmatch(tkn, "[^_]+") do
	--				spart = spart..part
@/lua/common/jsonDebug.lua
  local n = 1
  for w in s:gmatch("([^\n]*)") do
    curlen = curlen + #w
  local n = 1
  for w in s:gmatch("([^\n]*)") do
    curlen = curlen + #w
@/lua/common/utils.lua
  local i, t = 1, {}
  for v in string.gmatch(str, delimregex) do
    t[i] = v
@/lua/ge/extensions/editor/api/roadRiver.lua
    if childIDs ~= "" then
      for id in string.gmatch(childIDs, "%d+") do
        deleteRoad(tonumber(id))
    if decorationIDs then
      for decoID in string.gmatch(decorationIDs, "%d+") do
        scenetree.findObjectById(tonumber(decoID)):deleteObject()
@/lua/ge/extensions/editor/biomeTool.lua
  local i = 1
  for str in string.gmatch(getMissionFilename(),"([^/]+)") do
    if i == 2 then
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
          local mat
          for w in entry:gmatch("([^;]+)") do
            c = c + 1
@/lua/vehicle/electricsCustomValueParser.lua
  --find all literals (single letter, then >= 0 letters, numbers or _, so supported variable names in jbeam for this consist of [a-zA-Z0-9_])
  -- for s in expr:gmatch("%a[%a%d_%.]*") do
  --   print("Literal: " .. s)
@/lua/ge/extensions/editor/gen/utils.lua
	if not s or not d then return t end
	for str in string.gmatch(s, "([^"..d.."]+)") do
		if plain then
@/lua/ge/extensions/core/quickAccess.lua
    --log("I", "", "Building tree for path " .. path)
    for segment in string.gmatch(path, "[^/]+") do
      currentPath = currentPath .. segment .. "/"

  for segment in path:gmatch("/([^/]+)") do
    currentPath = currentPath .. segment .. "/"
  local count = 0
  for _ in path:gmatch("/[^/]+") do
    count = count + 1
@/lua/ge/extensions/gameplay/rally/notebook/structured/textCompositor.lua
      local digits = {}
      for digit in secondPart:gmatch("%d") do
        table.insert(digits, digit)
@/lua/ge/extensions/editor/terrainEditor.lua
  local i = 1
  for str in string.gmatch(getMissionFilename(),"([^/]+)") do
    if i == 2 then