Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell: Regular Expressions and Data.Text

When processing large amounts of textual data, it is recommended to use Data.Text instead of haskells native strings. Check, done. But how about regular expressions? Is there a regex library available, specialized on Data.Text? As far as I can see, all regular expression libraries are working on Haskell native Strings or even worse CStrings.

like image 729
scravy Avatar asked Feb 17 '13 15:02

scravy


People also ask

Does Haskell support regex?

This backend provides a Haskell interface for the "posix" c-library that comes with most operating systems, and is provided by include "regex.

What is show in Haskell?

The shows functions return a function that prepends the output String to an existing String . This allows constant-time concatenation of results using function composition.

What is the importance of regular expressions in data analytics?

Regular Expressions and Wildcards can be used for finding and replacing or removing text in a file, database, or filename. It is very powerful and can even assist in cleaning and reformatting data.


1 Answers

From the Data.Text documentation:

To use an extended and very rich family of functions for working with Unicode text (including normalization, regular expressions, non-standard encodings, text breaking, and locales), see the text-icu package: http://hackage.haskell.org/package/text-icu

More precisely Data.Text.ICU.Regex

like image 50
m0skit0 Avatar answered Sep 29 '22 12:09

m0skit0