I am doing a little test to grab backslash (\) using Python regex and what I found is a bit strange.
import re
stringing = "\\"
pattern = re.compile(r'(\\)')
search = pattern.search(string)
print search.group()
The output is shown below, which is as expected
\
However, when I use .groups() as,
print search.groups()
I get
('\\',)
Which is clearly wrong. Not sure what is happening.

search.group()alone without print. It will give you'\\'not a backslash.for i in re.search(r'(\\)', s).groups(): print i