Easy way to find set of quotes

Steve Purcell stephen_purcell at yahoo.com
Tue Apr 24 12:21:27 EDT 2001


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?

> 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? :-)

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

Good luck!

-Steve

-- 
Steve Purcell, Pythangelist
Get testing at http://pyunit.sourceforge.net/
Any opinions expressed herein are my own and not necessarily those of Yahoo




More information about the Python-list mailing list