[kwlug-disc] Regular Expression to Match Movie Titles and Year and Ignore the rest.
William Park
opengeometry at yahoo.ca
Wed Jan 1 03:52:00 EST 2025
From the top of my head,
- cut the string on ".2012.720p."
- change "Zero.Dark.Thirty" to "Zero Dark Thirty "
- change ".2012.720p." to "(2012-720p)"
- change "BrRip.x264.BOKUTOX.YIFY.mp4" to ".mp4"
Or,
- cut the string on "." (period)
- loop through the substrings, and search for "2012" and/or "720p"
- reassemble parts
--
William
On 2024-12-31 11:22, John Driezen wrote:
> Can anyone give me a regular expression to turn the following filename
>
> "Zero.Dark.Thirty.2012.720p.BrRip.x264.BOKUTOX.YIFY.mp4"
>
> into
>
> "Zero Dark Thirty (2012)-720p.mp4"
>
> 201[0-9] matches the year
>
> How do I match the title before the year, and ignore everything after
> the ".720p"?
>
> John Driezen
>
>
>
> _______________________________________________
> kwlug-disc mailing list
> To unsubscribe, send an email to kwlug-disc-leave at kwlug.org
> with the subject "unsubscribe", or email
> kwlug-disc-owner at kwlug.org to contact a human being.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20250101/ca11900c/attachment.htm>
More information about the kwlug-disc
mailing list