import re
pattern=r'\d+'
pattern1= r'\d+\s'
place = re.search((pattern | pattern1),s)
I need this regex to work for s='2m' as well as s='2 m' so that I can find m and separate it also it should for in case of s='2 mins' or s= '2mins'
can someone please help me with this. Also PFA Thanks
re.search("|".join([pattern, pattern1]), s)?