regex-applicative

Regex-based parsing with applicative interface

https://github.com/feuerbach/regex-applicative

Version on this page:0.3.3
LTS Haskell 22.39:0.3.4
Stackage Nightly 2024-10-31:0.3.4
Latest on Hackage:0.3.4

See all snapshots regex-applicative appears in

MIT licensed by Roman Cheplyaka
Maintained by Roman Cheplyaka
This version can be pinned in stack with:regex-applicative-0.3.3@sha256:32129b4f0b2a3d370fb182dea4a2ee13aa127285f358f2f2224ffe982581df82,2001

regex-applicative

regex-applicative is aimed to be an efficient and easy to use parsing combinator library for Haskell based on regular expressions.

Perl programmers often use regular expressions for parsing, even if it is not an appropriate tool for the job, because Perl has so good support for regexps.

The opposite seems to be valid about Haskell programmers – they use parsing combinators (which recognize context-free or even context-sensitive grammars), even when the language is actually regular!

Hopefully, this library will improve the situation.

Installation

Install this library using cabal-install tool:

cabal update
cabal install regex-applicative

Documentation

The API reference is available from Hackage.

To get started, see some examples on the wiki.

Other resources

Changes

Changes

0.3.3

Add replace

0.3.2.1

  • Use strict left fold in decimal/hexadecimal
  • Include a missing test module in the sdist tarball

0.3.2

Add msym

0.3.1

Add comap

0.3.0.3

  • Fix the test suite
  • Fix build with GHC 7.9

0.3.0.2

Fix the test suite

0.3.0.1

Port the test suite to tasty

0.3

  • Add a new module, Text.Regex.Applicative.Common, which contains some commonly used regexps (by Aleksey Khudyakov)
  • Improve the test suite

0.2.1

  • Add the withMatched function
  • Make matching functions a bit more lax
  • Fix a bug in the empty method

0.2

  • Infix matching functions
  • Improved documentation
  • Improved performance
  • Improved portability

0.1.5

  • Expose Object interface
  • Allow matching prefixes rather than the whole string
  • Add non-greedy repetitions

0.1.4

  • Completely rewrite the engine. Now it’s faster and runs in constant space.
  • Add ‘string’ function and ‘IsString’ instance.

0.1.3

  • Fix a .cabal-file issue introduced in 0.1.2
  • Change the fixity of =~

0.1.2

  • Relax the constraint on the containers version

0.1.1

  • Fix a bug in ‘reFoldl’ and ‘many’
  • “Lazy” infinite regexes are no longer supported

0.1

  • Initial release