Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2023-04-16 15:33
Flavor·PCRE2 (PHP)

/
^(.+?)[-. ]{0,3}(S(\d?\d)[E](\d\d)|(S(\d?\d)))[-. ]{0,3}
/
gm
Open regex in editor

Description

i was having a difficult time matching delimited episode names AND season names.

since episodes follow:

show.name.Sxx.Exx.resolution.source

and seasons:

show.name.year.Sxx.reso.source

and sometimes show names end in S followed by year when its a duplicate named show after the original. i'd get bad matches with movie names. hopefully this can help someone with a similar issue

Submitted by Gallo S. Chingon