...id|123|...
I need to get the id value. I tried:
print(re.search('id|(.*?)|', str)
but it printed a space
CodePudding user response:
"|" in regular expression means "either or"
"\|" searches for the character "|"
try 'id\|(.*?)\|'

...id|123|...
I need to get the id value. I tried:
print(re.search('id|(.*?)|', str)
but it printed a space
CodePudding user response:
"|" in regular expression means "either or"
"\|" searches for the character "|"
try 'id\|(.*?)\|'