text-0.11.2.0: An efficient packed Unicode text type.

PortabilityGHC
Stabilityexperimental
Maintainerbos@serpentine.com, rtomharper@googlemail.com, duncan@haskell.org
Safe HaskellSafe-Infered

Data.Text.Lazy.Search

Description

Fast substring search for lazy Text, based on work by Boyer, Moore, Horspool, Sunday, and Lundh. Adapted from the strict implementation.

Synopsis

Documentation

indicesSource

Arguments

:: Text

Substring to search for (needle)

-> Text

Text to search in (haystack)

-> [Int64] 

O(n+m) Find the offsets of all non-overlapping indices of needle within haystack.

This function is strict in needle, and lazy (as far as possible) in the chunks of haystack.

In (unlikely) bad cases, this algorithm's complexity degrades towards O(n*m).