Re: Regular expression use

2007-08-24 Thread garage
I work in print (book) production and i regularly use regular
expressions to parse .eps (encapsulated postscript) files for
incorrect specifications (8-bit vs. ASCII, etc), bad fonts and the
like.  Just to ensure that what's been submitted to me will actually
end up on the page.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Matching XML Tag Contents with Regex

2007-12-11 Thread garage
> Is what I'm trying to do possible with Python's Regex library? Is
> there an error in my Regex?

Search for '*?' on http://docs.python.org/lib/re-syntax.html.

To get around the greedy single match, you can add a question mark
after the asterisk in the 'content' portion the the markup.  This
causes it to take the shortest match, instead of the longest. eg

<%(tagName)s\s[^>]*>[.\n\r\w\s\d\D\S\W]*?[^(%(tagName)s)]*

There's still some funkiness in the regex and logic, but this gives
you the three matches
-- 
http://mail.python.org/mailman/listinfo/python-list