Here are two examples of the exact same regex pattern matching in Python and R
Python:
In[1]: import re
In[2]: reg = re.compile("oa")
In[3]: files = [".vim", ".jupyter", "Downloads", "Documents", ".bashrc", "R", "Python"]
In[4]: [x for x in files if reg.match(x)]
Out[4]: []
R:
> files <- c(".vim", ".jupyter", "Downloads", "Documents", ".bashrc", "R", "Python")
> grep("oa", files, value = TRUE)
[1] "Downloads"
Why doesn't the Python regex return anything?