I have strings similar to
text='Studied b-tech from college in 2010-13'
Using
text.replace('-', ' ')
will produce
Studied b tech from college in 2010 13
But what I want is:
Studied b tech from college in 2010-13
I have prepared below pattern for grepping tokens like 2010-13
, but how do I use it in my code?
regex_pattern='(\d{4}-\d{2,4})'