Hello All,
I have some python code that pulls together titles and displays them on web pages.
Here is the section of code I am struggling with:
#string to grab title
titlePattern =r'''\s*(\([^\)]+\))?(?P<title>.*)'''
#returns the title part of the subject line
def getTitle (self,data):
return re.search (
PartParser.titlepattern,
self.getSubject \(data\),
re.X
\).group \("title\)
This code will print out a title with whitespace in the midde od the title
ie: This is a (whitespace here, spaces or tabs) great day.
I am trying to use join and split to make the tile read
ie: This is a great day.
I believe I can remove the whitespace with
newtitlePattern = ' '.join(titlePattern(1).split())
and
PartParser.newtitlePattern
but I an not sure where to put this in the code.
Please help