Python Forum
Help creating a pattern using the re module
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help creating a pattern using the re module
#6
(Jan-09-2019, 07:38 AM)Gribouillis Wrote: You could replace (?: - flubber)?\.(?:mp|MP)4$ with .mp4

That worked great. Thanks a lot. I think it's making sense. But let me make sure I understand what I think I understand.

In this case when I compile a pattern and use patt.sub(repl, filename), I didn't need to capture the beginning of the string with (.+) because the entire string is already going to be returned with only the changes applied?

Thanks again.
Reply


Messages In This Thread
RE: Help creating a pattern using the re module - by zulu_likuum - Jan-09-2019, 05:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  'no module named' when creating packages mbastida 4 4,119 Nov-30-2021, 10:43 AM
Last Post: Gribouillis
  ModuleNotFoundError: No module named 'psutil' after creating .exe ? ABhishek 3 11,632 Jul-30-2019, 01:44 PM
Last Post: ABhishek
  Regex, creating a pattern stahorse 5 3,294 Apr-24-2019, 08:29 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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