<div dir="ltr">You could also use:<br><br>^([A-Za-z]+(?:\.[A-Za-z]+)*)\.(\d{4})\.(\d+p)\..*\.(mp4|mkv|avi)$<br><br>Explanation:<br>^: Anchors the regex to the start of the string.<br>([A-Za-z]+(?:\.[A-Za-z]+)*): This part matches the title. It captures words separated by dots (e.g., Zero.Dark.Thirty will be captured as Zero Dark Thirty).<br>([A-Za-z]+): Matches the first word.<br>(?:\.[A-Za-z]+)*: Matches any additional words separated by dots.<br>\.(\d{4}): Matches the year (a 4-digit number).<br>\.(\d+p): Matches the resolution (e.g., 720p, 1080p).<br>\..*: Matches any additional characters between the resolution and the file extension (e.g., BrRip.x264.BOKUTOX.YIFY).<br>\.(mp4|mkv|avi): Matches the file extension (mp4, mkv, avi, etc.).</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, 31 Dec 2024 at 11:29, John Driezen <<a href="mailto:jdriezen@sympatico.ca">jdriezen@sympatico.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Can anyone give me a regular expression to turn the following filename<br>
<br>
"Zero.Dark.Thirty.2012.720p.BrRip.x264.BOKUTOX.YIFY.mp4"<br>
<br>
into<br>
<br>
"Zero Dark Thirty (2012)-720p.mp4"<br>
<br>
201[0-9] matches the year<br>
<br>
How do I match the title before the year, and ignore everything after <br>
the ".720p"?<br>
<br>
John Driezen<br>
<br>
<br>
<br>
_______________________________________________<br>
kwlug-disc mailing list<br>
To unsubscribe, send an email to <a href="mailto:kwlug-disc-leave@kwlug.org" target="_blank">kwlug-disc-leave@kwlug.org</a><br>
with the subject "unsubscribe", or email<br>
<a href="mailto:kwlug-disc-owner@kwlug.org" target="_blank">kwlug-disc-owner@kwlug.org</a> to contact a human being.<br>
</blockquote></div>