Light Mode
Dark Mode
Could you please with syntax

I'm trying to use variable 'b' in re.findall with operators '\w+' but get syntax error

THIS DOESN'T WORK

import re
a = '>text<'
b = '>'
d = re.findall (r b\w+, a)
print (d)

BUT THIS IS WORKING:

import re
a = '>text<'
b = '>'
d = re.findall (r '>\w+', a)
print (d)
Created: Feb. 8, 2018, 12:12 p.m.
Updated: Feb. 9, 2018, 11:50 a.m.
0
5
User avatar
georimer