ppannuto / python-titlecase

Python library to capitalize strings as specified by the New York Times Manual of Style
MIT License
244 stars 36 forks source link

Allow use of stdlib "re" package as an alternative to regex #75

Closed rkhwaja closed 3 years ago

rkhwaja commented 3 years ago

It would make the install pure python, particularly relevant right now for me because it won't install on macos arm64 since regex doesn't have a wheel for this architecture.

ppannuto commented 3 years ago

Not sure I know enough to know if there are any meaningful difference between 're' and 'regex' -- happy to take a PR that makes the switch; if the test cases pass, I'll merge it.

rkhwaja commented 3 years ago

Fixed by https://github.com/ppannuto/python-titlecase/pull/76

rkhwaja commented 3 years ago

Doesn't work. I get an error on the following line: INLINE_PERIOD = re.compile(r'[\p{Letter}][.][\p{Letter}]')

ppannuto commented 3 years ago

I think my answer is the same as before: Happy to take a PR to fix, and I guess also a test case that validates that re is being used as expected on the platforms where you're having issues. The regex vs re thing doesn't affect any of the setups I own, so it's hard for me to test/debug/fix.

ppannuto commented 3 years ago

I believe this should now be fixed. Please re-open if there are remaining issues.