Python Forum
Replace changing string including uppercase character with lowercase character
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace changing string including uppercase character with lowercase character
#1
Hello Smile

My input lines :
<p>Material blabla ;<lb/>Dimension blabla ;<lb/></p>
<p>Sideral blublu ;<lb/>Sticky Gonzalez blibli;<lb/>Reductio ad absurdum bloblo</p>
For each "<lb/>" followed by an uppercase character, I want it replaced with a white space + same character but lowercase.

My wished output :
<p>material blabla ; dimension blabla ;<lb/></p>
<p>Sideral blublu ; sticky Gonzalez blibli; reductio ad absurdum bloblo</p>
I made several re.sub trials with unsuccessful regular expressions. I also read several things about it : it seems not so easy for a beginner in programming like me. So, if you have not an easy solution, please tell me what I should learn first before understanding it.

Thank you Smile
Reply


Messages In This Thread
Replace changing string including uppercase character with lowercase character - by silfer - Mar-23-2019, 01:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Text conversion to lowercase is not working ineuw 3 466 Jan-16-2024, 02:42 AM
Last Post: ineuw
  Virtual Env changing mysql connection string in python Fredesetes 0 377 Dec-20-2023, 04:06 PM
Last Post: Fredesetes
  Python rule about the space character surrounding the equal sign ineuw 10 1,627 Sep-21-2023, 09:17 AM
Last Post: ineuw
  How do I handle escape character in parameter arguments in Python? JKR 6 1,147 Sep-12-2023, 03:00 AM
Last Post: Apoed2023
  Function to count words in a list up to and including Sam Oldman45 15 6,571 Sep-08-2023, 01:10 PM
Last Post: Pedroski55
  Need to replace a string with a file (HTML file) tester_V 1 763 Aug-30-2023, 03:42 AM
Last Post: Larz60+
Question UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 562: ord ctrldan 23 4,814 Apr-24-2023, 03:40 PM
Last Post: ctrldan
  Replace string in a nested Dictianory. SpongeB0B 2 1,201 Mar-24-2023, 05:09 PM
Last Post: SpongeB0B
  use of escape character in re.sub and find WJSwan 1 910 Feb-16-2023, 05:19 PM
Last Post: Larz60+
  Replace with upper(string) WJSwan 7 1,586 Feb-10-2023, 10:28 AM
Last Post: WJSwan

Forum Jump:

User Panel Messages

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