From fd4103240aa8f0df3998212db7b89c20fd67e48c Mon Sep 17 00:00:00 2001 From: Theo Leuthardt <60556192+theoleuthardt@users.noreply.github.com> Date: Thu, 20 Feb 2025 20:24:01 +0100 Subject: [PATCH] no comments needed --- backend/src/routes/regextest.route.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/src/routes/regextest.route.ts b/backend/src/routes/regextest.route.ts index ef2f9a5..2776840 100644 --- a/backend/src/routes/regextest.route.ts +++ b/backend/src/routes/regextest.route.ts @@ -18,12 +18,10 @@ export async function regexTest(app: FastifyInstance) { return reply.status(400).send({ error: "No Regex declared!" }); } - // Überprüfe, ob die Felder regex und test vorhanden sind if (!data.regex || !data.test) { return reply.status(400).send({ error: "Regex or test string missing!" }); } - // Versuche, den regulären Ausdruck zu erstellen let regexPattern; try { regexPattern = new RegExp(data.regex); @@ -31,10 +29,8 @@ export async function regexTest(app: FastifyInstance) { return reply.status(400).send({ error: "Invalid regular expression!" }); } - // Teste den Eingabestring gegen das Regex const result = regexPattern.test(data.test); - - // Erstelle die Antwort basierend auf dem Testergebnis + let output = ""; if (result) { output = `The input matches the regular expression!`;