I'm trying to do a regular expression match with special characters in it, such as "/", ".", and "-". This is the string:
17440 root 20 0 3645m 452m 12m S 152 11.8 347:32.04 test/1/02.3_4-6
But the following code does not seem to match at the end with :
m=re.search(r"(?P<pid>\d+) +(?P<user>\w+) +(?P<pr>[\w-]+) +(?P<ni>[\w-]+) +(?P<virt>\w+) +(?P<res>\w+) +(?P<shr>\w+) +(?P<st>\w) +(?P<cpu>\d+) +(?P<mem>\d.+) +(?P<time>[0-9:.]+) +(?P<proc_name>[\w-/.]+)", line)
Do I need backslash before the special characters, such as "/" and "."? Thanks!