<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--Rendered using the Haskell Html Library v0.2--> <HTML ><HEAD ><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" ><TITLE >Text.Regex.Posix</TITLE ><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" ><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" ></SCRIPT ><SCRIPT TYPE="text/javascript" >window.onload = function () {setSynopsis("mini_Text-Regex-Posix.html")};</SCRIPT ></HEAD ><BODY ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="topbar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " ></TD ><TD CLASS="title" >regex-posix-0.94.1: Replaces/Enhances Text.Regex</TD ><TD CLASS="topbut" ><A HREF="index.html" >Contents</A ></TD ><TD CLASS="topbut" ><A HREF="doc-index.html" >Index</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="modulebar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><FONT SIZE="6" >Text.Regex.Posix</FONT ></TD ><TD ALIGN="right" ><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="infohead" >Portability</TD ><TD CLASS="infoval" >non-portable (regex-base needs MPTC+FD)</TD ></TR ><TR ><TD CLASS="infohead" >Stability</TD ><TD CLASS="infoval" >experimental</TD ></TR ><TR ><TD CLASS="infohead" >Maintainer</TD ><TD CLASS="infoval" >libraries@haskell.org, textregexlazy@personal.mightyreason.com</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" ><B >Contents</B ></TD ></TR ><TR ><TD ><DL ><DT ><A HREF="#1" >Wrap, for <TT ><A HREF="Text-Regex-Posix-Wrap.html#v%3A%3D~" >=~</A ></TT > and <TT ><A HREF="Text-Regex-Posix-Wrap.html#v%3A%3D~~" >=~~</A ></TT >, types and constants </A ></DT ></DL ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Description</TD ></TR ><TR ><TD CLASS="doc" ><P >Module that provides the Regex backend that wraps the c posix regex api. This is the backend being used by the regex-compat package to replace Text.Regex </P ><P >The <A HREF="Text-Regex-Posix.html" >Text.Regex.Posix</A > module provides a backend for regular expressions. If you import this along with other backends, then you should do so with qualified imports, perhaps renamed for convenience. </P ><P >If the <TT ><A HREF="Text-Regex-Posix-Wrap.html#v%3A%3D~" >=~</A ></TT > and <TT ><A HREF="Text-Regex-Posix-Wrap.html#v%3A%3D~~" >=~~</A ></TT > functions are too high level, you can use the compile, regexec, and execute functions from importing either <A HREF="Text-Regex-Posix-String.html" >Text.Regex.Posix.String</A > or <A HREF="Text-Regex-Posix-ByteString.html" >Text.Regex.Posix.ByteString</A >. If you want to use a low-level Foreign.C.CString interface to the library, then import <A HREF="Text-Regex-Posix-Wrap.html" >Text.Regex.Posix.Wrap</A > and use the wrap* functions. </P ><P >This module is only efficient with Data.ByteString.ByteString only if it is null terminated, i.e. <TT >(Bytestring.last bs)==0</TT >. Otherwise the library must make a temporary copy of the Data.ByteString.ByteString and append the NUL byte. </P ><P >A <TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AString" >String</A ></TT > will be converted into a Foreign.C.CString for processing. Doing this repeatedly will be very inefficient. </P ><P >Note that the posix library works with single byte characters, and does not understand Unicode. If you need Unicode support you will have to use a different backend. </P ><P >When offsets are reported for subexpression captures, a subexpression that did not match anything (as opposed to matching an empty string) will have its offset set to the <TT ><A HREF="Text-Regex-Posix-Wrap.html#v%3AunusedRegOffset" >unusedRegOffset</A ></TT > value, which is (-1). </P ><P >Benchmarking shows the default regex library on many platforms is very inefficient. You might increase performace by an order of magnitude by obtaining libpcre and regex-pcre or libtre and regex-tre. If you do not need the captured substrings then you can also get great performance from regex-dfa. If you do need the capture substrings then you may be able to use regex-parsec to improve performance. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Synopsis</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetVersion_Text_Regex_Posix" >getVersion_Text_Regex_Posix</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Version.html#t%3AVersion" >Version</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" >module <A HREF="/usr/share/doc/ghc/html/libraries/regex-base-0.93.1/Text-Regex-Base.html" >Text.Regex.Base</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" >module <A HREF="Text-Regex-Posix-Wrap.html" >Text.Regex.Posix.Wrap</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Documentation</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getVersion_Text_Regex_Posix" ><A NAME="v%3AgetVersion_Text_Regex_Posix" ></A ></A ><B >getVersion_Text_Regex_Posix</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Version.html#t%3AVersion" >Version</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" >module <A HREF="/usr/share/doc/ghc/html/libraries/regex-base-0.93.1/Text-Regex-Base.html" >Text.Regex.Base</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section2" ><A NAME="1" ><A NAME="1" >Wrap, for <TT ><A HREF="Text-Regex-Posix-Wrap.html#v%3A%3D~" >=~</A ></TT > and <TT ><A HREF="Text-Regex-Posix-Wrap.html#v%3A%3D~~" >=~~</A ></TT >, types and constants </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" >module <A HREF="Text-Regex-Posix-Wrap.html" >Text.Regex.Posix.Wrap</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="botbar" >Produced by <A HREF="http://www.haskell.org/haddock/" >Haddock</A > version 2.6.0</TD ></TR ></TABLE ></BODY ></HTML >