[Haskell-beginners] Regular expressions in case

legajid legajid at free.fr
Fri Feb 12 16:05:57 EST 2010


Hi,
is it possible to write regular expressions in case .. of ?

I tried it, with no success.

a x =
    case x of
        "a1"     -> "A1"
        "a2"     -> "A2"
        "a*"     -> "A*"
        "b1"     -> "B1"
        _     -> "_"


for x="a3", result is _, instead of A* that i wanted.

Thks,
Didier


More information about the Beginners mailing list