[Haskell-cafe] checking regular expressions

2007-11-08 Thread Uwe Schmidt
Hi all,

what's the simplest way to check, whether a given string
is a wellformed regular expression?

In the API there's just a mkRegex which does not make
any checks, and the matchRegex which throws an exception
when the regex isn't wellformed.

So do I need the IO monad for checking a regex?

Uwe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] checking regular expressions

2007-11-08 Thread Alfonso Acosta
You don't need IO. Just need to use the (=~) operator (which can be
confusing due to it's polymorphism).

Take a look at 
http://www.serpentine.com/blog/2007/02/27/a-haskell-regular-expression-tutorial/
for didactive examples.

On Nov 8, 2007 4:21 PM, Uwe Schmidt [EMAIL PROTECTED] wrote:
 Hi all,

 what's the simplest way to check, whether a given string
 is a wellformed regular expression?

 In the API there's just a mkRegex which does not make
 any checks, and the matchRegex which throws an exception
 when the regex isn't wellformed.

 So do I need the IO monad for checking a regex?

 Uwe
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe