Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
where is a pattern?
#1
i have a string pattern (such as '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].[0-9][0-9][0-9]') that may be in another string. i'm still baffled by the re module (i guess i just can't get into a perl frame of mind). i want to know the start and end position where the matched substring is. but the .start and .end methods in a match object want an argument that makes no sense to me. who knows how to use this?

even better would be a function that can extract a date and time substring in any date and time format (even if it is ambiguous between date and month) and extract it and return the part before the date and time, the date and time substring, and the part after the date and time.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
where is a pattern? - by Skaperen - Jun-07-2019, 05:07 AM
RE: where is a pattern? - by heiner55 - Jun-07-2019, 05:16 AM
RE: where is a pattern? - by Skaperen - Jun-07-2019, 05:37 AM
RE: where is a pattern? - by heiner55 - Jun-07-2019, 06:55 AM
RE: where is a pattern? - by Skaperen - Jun-07-2019, 01:08 PM
RE: where is a pattern? - by Gribouillis - Jun-07-2019, 08:53 AM
RE: where is a pattern? - by heiner55 - Jun-07-2019, 01:38 PM
RE: where is a pattern? - by snippsat - Jun-07-2019, 04:25 PM
RE: where is a pattern? - by Skaperen - Jun-07-2019, 11:57 PM

Forum Jump:

User Panel Messages

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