You forgot a dot in front of the asterisk:
rename -n 's/(\w+) - (\d{1})x(\d{2}).*$/S0$2E$3\.srt/' *.srt
On OpenSUSE, RedHat, Gentoo you have to use Perl version of rename
. This answer shows how to obtain it. On Arch, the package is called perl-rename
.
More Related Contents:
- Find and kill a process in one line using bash and regex
- R dplyr: rename variables using string functions
- How can I match “anything up until this sequence of characters” in a regular expression?
- How can I validate an email address using a regular expression?
- Regex Last occurrence?
- Regular expression to match string starting with a specific word
- How to wisely combine shingles and edgeNgram to provide flexible full text search?
- Regular Expression Arabic characters and numbers only
- How to match, but not capture, part of a regex?
- RegEx to match full string
- regex, extract string NOT between two brackets
- How to print matched regex pattern using awk?
- Regex for extracting filename from path
- Validate mathematical expressions using regular expression?
- Regex that does not allow consecutive dots
- What is a regex to match ONLY an empty string?
- htaccess 301 redirect – Remove query string (QSA)
- Lazy quantifier {,}? not working as I would expect
- Recursively change file extensions in Bash
- Test for numeric elements in a character string
- Is There a Way to Match Any Unicode Alphabetic Character?
- Regex validation of email addresses according to RFC5321/RFC5322
- Eliminate newlines in google app script using regex
- Regular Expression for getting everything after last slash [duplicate]
- Regex: Get Filename Without Extension in One Shot?
- Grep and regex – why am I escaping curly braces?
- Replace first occurrence of “:” but not second in R
- Multiline Regex in PowerShell
- Powershell script to remove double quotes from CSV unless comma exists inside double quotes
- grep regex whitespace behavior