headroom-0.2.2.1: License Header Manager

Copyright(c) 2019-2020 Vaclav Svejcar
LicenseBSD-3-Clause
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.Regex

Description

Provides wrappers mainly around functions from Text.Regex.PCRE.Light that more suits the needs of this application.

Synopsis

Documentation

compile' Source #

Arguments

:: Text

regular expression to be compiled

-> Regex

compiled regular expression

Same as compile, but takes Text on input and enables utf8 option by default.

joinPatterns Source #

Arguments

:: [Text]

list of patterns to join

-> Maybe Text

joined patterns

Joins list of patterns into single regex string. If the input list is empty, Nothing is returned.

>>> joinPatterns ["^foo", "^bar"]
Just "^foo|^bar"

match' Source #

Arguments

:: Regex

a PCRE regular expression value produced by compile

-> Text

the subject text to match against

-> Maybe [Text]

the result value

Same as match, but works with Text and uses no additional options.