[Haskell-cafe] How does one use Text.Regex.Base.RegexLike?
Lyle Kopnicky
lists at qseep.net
Tue Dec 23 15:30:33 EST 2008
Yes, that worked, thanks. I just figured that out too. Here's a whole
working program:
import Text.Regex.Base
import Text.Regex.Posix
rx :: Regex
rx = makeRegex "a(.*)A"
mr = match rx "abcdA"
text = head $ mrSubList mr
main = putStrLn text
On Tue, Dec 23, 2008 at 12:30 PM, Daniel Fischer
<daniel.is.fischer at web.de>wrote:
> Am Dienstag, 23. Dezember 2008 21:09 schrieb Lyle Kopnicky:
> > Yes, sort of. It enables me to get some simple examples working with
> (=~).
> > But I still don't know how to get makeRegex to work. You need it to
> specify
> > options like case insensitivity, or to use functions like matchAllText.
> >
>
> Your problem is that GHC can't know which instance to choose. You can help
> it
> by giving a type signature, e.g.
>
> rx :: Regex
> rx = makeRegex "a(.*)A"
>
> HTH,
> Daniel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081223/c2cf5211/attachment.htm
More information about the Haskell-Cafe
mailing list