From 409e9dc95aa9f17770f21d11a65ec839da699f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 7 Oct 2022 13:41:11 +0200 Subject: Regex expansion --- src/Main.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index b19796a..28b88ae 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -14,8 +14,6 @@ import qualified Data.Text as T import qualified Data.Text.IO as T import Text.Read (readMaybe) -import Text.Regex.TDFA -import Text.Regex.TDFA.Text import System.Console.GetOpt import System.Directory @@ -238,7 +236,7 @@ spawnOn target pname killWith cmd = do return process tryMatch :: Regex -> [Text] -> Maybe ((Text, [Text]), [Text]) -tryMatch re (x:xs) | Right (Just (_, _, _, capture)) <- regexec re x = Just ((x, capture), xs) +tryMatch re (x:xs) | Right (Just (_, _, _, capture)) <- regexMatch re x = Just ((x, capture), xs) | otherwise = fmap (x:) <$> tryMatch re xs tryMatch _ [] = Nothing -- cgit v1.2.3