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

you are missing + to concatenate variable to the string.

Jump to Post

All 2 Replies

you are missing + to concatenate variable to the string.

Be a part of the DaniWeb community

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