Hi,
i have this code:

s = "hi john'
re.serach(r'j\w+h', s).group()
and up to here there is no problem but i want to put the letter h in a str variable
l = "h"
re.search(r'j\w+'l, s).group()
but when i do this i receive an error??

Recommended Answers

All 2 Replies

you are missing + to concatenate variable to the string.

thanks a lot!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.