Tag parsing in python

Josh English joshua.r.english at gmail.com
Sat Aug 28 18:12:17 EDT 2010


On Aug 28, 9:14 am, agnibhu <dee... at gmail.com> wrote:
> Hi all,
>
> I'm a newbie in python. I'm trying to create a library for parsing
> certain keywords.
> For example say I've key words like abc: bcd: cde: like that... So the
> user may use like
> abc: How are you bcd: I'm fine cde: ok
>
> So I've to extract the "How are you" and "I'm fine" and "ok"..and
> assign them to abc:, bcd: and cde: respectively.. There may be
> combination of keyowords introduced in future. like abc: xy: How are
> you
> So new keywords qualifying the other keywords so on..
> So I would like to know the python way of doing this. Is there any
> library already existing for making my work easier. ?
>
> ~
> Agnibhu

Have you looked at pyparsing? (http://pyparsing.wikispaces.com/) It
may
be possible to use that library to do this.

Josh






More information about the Python-list mailing list