Titlecase fails on strings containing numbers

Bug #722441 reported by mlissner on 2011-02-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
titlecase
Undecided
Unassigned

Bug Description

If a string contains a number, the ALL_CAPS regex won't match it, and as a result, the string won't get cast to lowercase. The simple solution to this is to add a line as follows:
NUMS = '0|1|2|3|4|5|6|7|8|9'

And then change the ALL_CAPS regex to:
ALL_CAPS = re.compile(r'^[A-Z\s%s%s]+$' % (PUNCT, NUMS))

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers