# Need help tweaking a regexp to accept only *.c files (1 Viewer)

#### awsdert

##### Newcomer
This is where I'm at:
Code:
``````for _,prj in ipairs(projects) do
cfg[prj] =
{
src_files = allsubents
(
{
ignore = function(ud)
if ud.mode == "directory" then
return false
end
local found = string.match(ud.name,".*\\.c\$")
end
}, "src/" .. prj
).ents
}
configure
(
"cfg." .. prj .. ".src_files", ":=",
joinstrings( nil, cfg[prj].src_files ), info
)
end``````
Thought I had it right but get no output and yes I have checked allsubents() works correctly, used it for to identify all cfg.mak files (since that's just a simple string comparison on the name alone was easy to get right), and yes I've also checked I get the right projects listed (that one uses a variant of allsubents, allsubdirs), it's just the regexp that's messing up the output

#### awsdert

##### Newcomer
Never mind, finally found the info I needed, just needed to replace the \\ with another . to escape the .