Need help with re for matching and getting the value python
- by laspal
Hi,
Need help regarding re.
file = 'file No.WR79050107006 from files'
So what I am trying to do is validate if file string contains WR + 11 digit.
result = re.match('^(\S| )*(?P<sr>(\d){11})(\S| )*', file)
Its validate only 11 digit but not WR before it.
How can I do that?
Using re after matching how can I get the match value ( WR79050107006)
I can do string find
index = file.find('file No.')
and then get the value of next 13 char.
thanks