struct mbuh
(
lineshg = 0,
tres = "text",
fn track all:#() =
(
local c -- clone
local lpoint = [0,0,0] -- previous point created
local ccoll = #() -- array for created objects
local prev = [0,0] -- var for alt distance changing
),
fn listzfun trs:123 x:#() =
(
obj = snapshotasmesh a
min_vz = max_vz = in coordsys world (getvert obj 1).z
min_vx = max_vx = in coordsys world (getvert obj 1).x
min_vy = max_vy = in coordsys world (getvert obj 1).y
)
)
fn brung man: =
(
)
as the example above , I want to find word "struct xx" & "fn xxx" but only "fn xxx" that inside struct scope not outside it ["fn brung xxx"], I use this regex to find it
^.*?(\bstruct\s*\w+\b)|^.?(\bfn\b+[\w\s:#()""]*)
but its search all fn word inside and outside struct scope, so the question is how can I find word fn xxx that only inside struct scope which is in example above [fn track xxx and fn listzfun xxx] ?
Thank you very much.