Just saving some RegEx that I use :D

Season and Episode:

[Ss]\d{2}[Ee]\d{2}

Example:

  • S01E10
  • s11E12
  • S30e01

Video Types

*\.(webm|mkv|flv|vob|ogv|ogg|drc|gif|gifv|mng|avi|mov|qt|wmv|yuv|rm|rmvb|asf|amv|mp4|m4p|m4v|mpg|mp2|mpeg|mpe|mpv|mpg|mpeg|m2v|m4v|svi|3gp|3g2|mxf|roq|nsv|f4v|f4p|f4a|f4b)

Note that in the above example, it is case sensitive. I opted to not imlement a case sensitive RegEx as it varies between RegEx implementations. See here for more details. See this page on Wikipedia for an explanation on extension types.

Example matches:

  • mymovie.mkv
  • sickclip.mp4
  • stuff.avi

Examples use (Linux):

# to search $SOURCE_DIR and cp RegEx matches to $TARGET_DIR
# be sure not to overwrite existing files with cp command (possibly use no clobber? -n)
find $SOURCE_DIR -regex ".*\.\(webm\|mkv\|flv\|vob\|ogv\|ogg\|drc\|gif\|gifv\|mng\|avi\|mov\|qt\|wmv\|yuv\|rm\|rmvb\|asf\|amv\|mp4\|m4p\|m4v\|mpg\|mp2\|mpeg\|mpe\|mpv\|mpg\|mpeg\|m2v\|m4v\|svi\|3gp\|3g2\|mxf\|roq\|nsv\|f4v\|f4p\|f4a\|f4b\)" -exec cp {} $TARGET_DIR \;

ipv4 address

^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$

source

URLS

https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)

source