summaryrefslogtreecommitdiff
path: root/chatcommands.lua
diff options
context:
space:
mode:
Diffstat (limited to 'chatcommands.lua')
-rw-r--r--chatcommands.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/chatcommands.lua b/chatcommands.lua
index e951142..00a31b0 100644
--- a/chatcommands.lua
+++ b/chatcommands.lua
@@ -172,6 +172,16 @@ minetest.register_chatcommand("find_areas", {
return
end
+ -- Check expression for validity
+ local function testRegExp()
+ ("Test [1]: Player (0,0,0) (0,0,0)"):find(param)
+ end
+ if not pcall(testRegExp) then
+ minetest.chat_send_player(name,
+ "Invalid regular expression.")
+ return
+ end
+
local found = false
for id, area in pairs(areas.areas) do
if areas:isAreaOwner(id, name) and