Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with regex
#2
This should work
re.sub(r'(?:(?<=\s)|^)\w', lambda m: m.group(0).upper(), s)
Reply


Messages In This Thread
Problem with regex - by Emekadavid - Jun-22-2020, 10:52 PM
RE: Problem with regex - by Gribouillis - Jun-23-2020, 06:31 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020