Home > Blockchain >  How to make a regex pattern? Python
How to make a regex pattern? Python

Time:09-04

...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\|(.*?)\|'

  • Related