Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Question about Regular expression pattern        consuming.
      (S. H. Aegis)


----------------------------------------------------------------------

Message: 1
Date: Sun, 28 Jul 2013 18:35:27 +0900
From: "S. H. Aegis" <shae...@gmail.com>
To: "beginners@haskell.org" <beginners@haskell.org>
Subject: [Haskell-beginners] Question about Regular expression pattern
        consuming.
Message-ID:
        <CAJp-NqwaSkR9VQRqrU0Q=ydunnxz+eqqm_stcdyyv8hqy+l...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi.
I'm newbie to Haskell.
I want to get date, it's type is [[String]].
The problem is that "the string that is used in regular expression pattern"
is consumed. ie, disappear.
Here is my code.

------------------------------------------------------------
import Text.Regex
import Control.Applicative

main :: IO()
main = do
    myIn <- readFile "Data.dat"
    print $ lines <$> intoEachPt myIn

intoEachPt :: String -> [String]
intoEachPt = splitRegex (mkRegex "20[0-9]{13}AH021")
-----------------------------------------------------------

How can I fix this?


Data:
....there is many DIGIT.....201306000300001AH02112361640
9.......

Output:
[[....there is many DIGIT..."],["12361640             9......]....]

I hope:
[[....there is many DIGIT..."],["201306000300001AH02112361640
9......]....]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130728/6b3376f0/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 61, Issue 33
*****************************************

Reply via email to