Good day everyone! I study programming, as well as being a serial lover and the task arose of automating the download of serials through a torrent client (qbittorrent). In this client, there is an RSS downloader to which filters are written via regular expressions. Given: RSS feed lostilm'a. (For example, a supernatural series that contains the following torrent names:

  • Supernatural. A handful of lucky (We Happy Few). (S11E22)
  • Supernatural. A handful of lucky (We Happy Few) [1080p]. (S11E22)
  • Supernatural. A handful of lucky (We Happy Few) [MP4]. (S11E22))

A regular search has been written to search for 1080p-quality TV shows:

Сверхъестественное\s\(\w+\)\.\s\D+\s\[1080p\] 

This regular works with lotstilm and will download any series, but it seems to me that it can be improved, but since I especially did not write on regulars (I know the basics only) it seems to me that you can write better. Specify how this can be done better.

  • Supernatural. * \ [1080p \] - rjhdby
  • So simple, and I was perverted, thanks. - Konstantin
  • You would also understand why regex101.com captures the character after the parentheses - regex101.com/r/cZ7lD0/1 . - Sasha Chernykh
  • Strange I have everything ok. regex101.com/r/bH9uP6/1 - Konstantin
  • @rjhdby make out as the answer, please - ReinRaus

1 answer 1

You can simplify a regular expression to:

 Сверхъестественное.*\[1080p\]