I am a python newbie and struggle to understand the usefulness of adding a single letter at the start of function's argument. Example is the following code:
reg_pattern = re.compile(r'[a-zA-Z0-9]')
What is the role of r
after .compile(
?
If I run:
>>> reg_pattern = re.compile(r'[a-zA-Z0-9]')
>>> reg_pattern.findall('Thanks!')
I get:
['T', 'h', 'a', 'n', 'k', 's']
And if I run it without the r
, I also get the same output. I also see other letter such as u
in different functions.