Hello,
I'm going to take the date data from the title of the post
The output value of the title of the post using Beautifulsoup is as follows.
"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
From these string data,
I'd like to have you collect it automatically in the form of
"xxx"xxx year xxx"
here, so what method should I use?
I don't think split or sliding methods should change the format of the title a little bit
Is there a way to extract only the format like "%d%d%d%d year%d%d month%d"
?
l = re.foundall(r'(\d{4})year(\d{1,2})month(\d{1,2})day', 'string data')
I think I can do it like thisYo
© 2024 OneMinuteCode. All rights reserved.