regex-0.8.0.0: Toolkit for regex-base

Safe HaskellNone
LanguageHaskell2010

Text.RE.Tools.Grep

Contents

Synopsis

Documentation

grep :: IsRegex re ByteString => Verbosity -> re -> FilePath -> IO () Source #

operates a bit like classic grep printing out the lines matched

data Line Source #

grepLines returns a Line for each line in the file, listing all of the Matches for that line

Constructors

Line 

Fields

Instances

grepLines :: IsRegex re ByteString => re -> FilePath -> IO [Line] Source #

returns a Line for each line in the file enumerating all of the matches for that line.

type GrepScript re s t = [(re, LineNo -> Matches s -> Maybe t)] Source #

a GrepScript lists RE-action associations, with the first RE to match a line selecting the action to be executed on each line in the file

grepScript :: IsRegex re s => GrepScript re s t -> [s] -> [t] Source #

given a list of lines, apply the GrepScript to each line of the file

report :: Verbosity -> [Line] -> String Source #

generate a grep report from a list of Line

linesMatched :: Verbosity -> [Line] -> [Line] Source #

given a velocity flag filter out either the lines matched or not matched

IsRegex

class Replace s => IsRegex re s where Source #

Minimal complete definition

matchOnce, matchMany, makeRegex, makeRegexWith, regexSource

Methods

matchOnce :: re -> s -> Match s Source #

matchMany :: re -> s -> Matches s Source #

makeRegex :: (Functor m, Monad m) => s -> m re Source #

makeRegexWith :: (Functor m, Monad m) => SimpleRegexOptions -> s -> m re Source #

regexSource :: re -> s Source #

LineNo

Text.RE

module Text.RE