[Haskell-beginners] Re: why is something different within a function when it comes out?

prad prad at towardsfreedom.com
Wed Jul 14 21:19:25 EDT 2010


On Wed, 14 Jul 2010 17:28:18 -0700
Michael Mossey <mpm at alumni.caltech.edu> wrote:

> For a parsing job, you might consider Parsec rather than regular 
> expressions.
ok thx for this, because it's bound to be useful down the road.
i'm just trying to grab lines from something like this the stuff
between the <text> ... </text>:

<text>
The Mission of the League of Humane Voters® (LOHV) is to create, unite,
and strengthen local political action committees, which work to enact
animal-friendly legislation and elect candidates for public office who
will use their votes and influence for animal protection.

As election time comes around, council candidates in Independence, Ohio
have taken the typical tactic of refusing to even answer questions
regarding their position on various matters.

Their 'silence speaks volumes'.
</text>

i'm using what chaddai showed me:
xtract p c = (c =~ p :: [[String]]) !! 0 !! 1
which works fine for single lines, but produces nothing for multiple
lines - same with some of the other ways i tried it with single lines
good, nothing for multiple. python requires setting the re.S flag which
i always found strange since \n i thought is a char as well.

-- 
In friendship,
prad

                                      ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's


More information about the Beginners mailing list