Copyright | (c) 2019-2020 Vaclav Svejcar |
---|---|
License | BSD-3 |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Useful functions for searching specific text fragments in input text, used by other modules to detect existing license headers in source code files.
Synopsis
- findLine :: (Text -> Bool) -> Text -> Int
- findLineStartingWith :: [Text] -> Text -> Int
- linesCountByRegex :: Regex -> Text -> Int
- reML :: QuasiQuoter
Documentation
:: (Text -> Bool) | predicate to find line |
-> Text | input text |
-> Int | number of line that matches given predicate |
Finds line in given text that matches given predicate and returns its line number.
Finds line starting with one of given patterns and returns its line number
(specialized form of findLine
).
Count lines that matches the given (multiline) regex. Useful for example to find how many lines are taken by multi-line comment in source code.
reML :: QuasiQuoter Source #
Regex configuration for matching multi-line UTF strings.