I’m trying to do a regex on this string
JavaScript
x
2
1
str1 = "/*Jon is @developer & musician"
2
And it must return
“Jon is developer musician”
But in pyothon it just returns “Jon”
Advertisement
Answer
What about this.
JavaScript
1
6
1
>>> str1 = "/*Jon is @developer & musician"
2
>>> re.findall(r"w+s*", str1)
3
['Jon ', 'is ', 'developer ', 'musician']
4
>>> "".join(re.findall(r"w+s*", str1))
5
'Jon is developer musician'
6