I'm new to regex in python. I tried finding answers over web from my problem but none of those works. I'm trying to replace the 's with "is" only if it is preceded by a singular pronoun. so word's like "he's", "it's", etc. are to be replaced by "he is", "it is".
What I tried was:
line1 = "It's done. But there's some more you have to do. Gary's dog is in the precinct. Get it home. It's too far. There's rain"
re.sub("(?<=[it|that|here|there|he|she])'s",' is',line1,re.IGNORECASE)
Answer I got:
"It is done. But there is some more you have to do. Gary's dog is in the precinct. Get it home. It's too far. There's rain"
It is doing what I want in first two sentences but not in later sentences. Can anyone point out my mistake and solution to it?