Regular expression to match only the first file in a RAR file set

后端 未结 4 842
半阙折子戏
半阙折子戏 2021-01-16 00:39

To see what file to invoke the unrar command on, one needs to determine which file is the first in the file set.

Here are some sample file names, of which - naturall

4条回答
  •  青春惊慌失措
    2021-01-16 00:59

    I am no regex expert but here is my attempt

    ^(yes|no)\.(rar|part0*1\.rar)$
    

    Replace "yes|no" with the actual file name. I matched it against your examples to see if it would only match the first set hence the "yes|no" in the regex.

    UPDATE: fixed as per the comment. Not sure why the user would not know the filename so i did not fix that part...

提交回复
热议问题