I have a series of file names of the form "J9.0_Feature_ML_111.json". I need to retrieve the integer number after the J and before the "."
I can get it on Pythex.org using (?<=J)(\d+)
but when I try and implement it in Python using
import re
filename = 'J9.0_Feature_ML_111.json'
num = re.match(r"(?<=J)(\d+)", filename).group()
I get a NoneType object returned. Is anyone able to help me with this please? I'm using Python 3.5.4. conda list
doesn't give me a version of re
so I assume it's part of the base package?