Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
re
#3
(Jul-15-2021, 01:27 PM)snippsat Wrote:
(Jul-15-2021, 09:04 AM)menator01 Wrote: 'm trying to get just the Money Honey part.
Something like this.
>>> import re 
>>> 
>>> s = '01-09- Money Honey'
>>> re.findall(r'\w+\s\w+', s)
['Money Honey']
>>> 
>>> r = re.search(r'(\w+\s\w+)', s)
>>> r.group(1)
'Money Honey'

Many thanks, that has gave me something to play around with.
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts


Reply


Messages In This Thread
re - by menator01 - Jul-15-2021, 09:04 AM
RE: re - by snippsat - Jul-15-2021, 01:27 PM
RE: re - by menator01 - Jul-15-2021, 02:49 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020