Easy way to find set of quotes

Jeff Shipman shippy at nmt.edu
Tue Apr 24 12:28:55 EDT 2001


On Tue, 24 Apr 2001, Steve Purcell wrote:

> Jeff Shipman wrote:
> > I'm reading a file that has a kind of mark-up
> > language, and I'm supposed to convert it all
> > to HTML. No problem, really, it's no that
> > hard of a mark-up language, but there are a
> > couple things for which I'm sure python has
> > some tricks that would make life easier which
> > I don't know about.
>
> Sounds like a Wiki. Are we doing your homework?

A Wiki? And yes, this is for a Zero-Defect Software
Development project.

>
> > My question is: is there an easy way to find all
> > of these different patters and surround the proper
> > text? Note that things inside quotes are not
> > touched. So, if I had ""my '''text'''"", that
> > would output <BLOCKQUOTE>my '''text'''</BLOCKQUOTE>.
> > I know that python must have something handy for
> > this besides going through character-by-character
> > and keeping track of my current location.
>
> > Unfortunately, I'm not allowed to use regular expressions.
>
> Doh! This *is* your homework! Does this newsgroup query count as
> effective use of resources, or as unfair assistance? :-)
>

This would count as effective use of resources as I'm a
Senior, and I know how to program. :) I'm merely looking
for a hint or two, not a full blown-out code block.

> I'll restrain myself to the following hint: Look at the string module,
> specifically string.find().

I suppose I could do some weird python-fu with string.find().
Thanks for the hint.

> Good luck!

Thanks!

Jeff "Shippy" Shipman     E-Mail: shippy at nmt.edu
Computer Science Major    ICQ: 1786493
New Mexico Institute of Mining and Technology
Homepage: http://www.nmt.edu/~shippy





More information about the Python-list mailing list