Why is my regular expression adding am line break before the closing tag?
string = '\s ప్రపంచ ప్రారంభం'
re.sub(r'\\s (.*)', r'<h3>\1</h3>', string)
what I get
<h3>ప్రపంచ ప్రారంభం
</h3>
what I want
<h3>ప్రపంచ ప్రారంభం</h3>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Take a look at the text part of your string, make sure there’s nothing there creating a line break. When I tried:
I got:
I was using Python 2.7.3.