Almost there!
- The first group was including the second tag in the filename (eg. _S90_), hence the addition of the second " _.+ "
- Changed the structure of the expression to include the underscore after the _R[12]
The command with the final changes:
brename -p '^(\w+)_.+_.+(_R[12]_).+' -r '${1}$2.fastq.gz' -d
- Included the -d for the dry run tests ;)
Thanks a bunch and congratulations on your software, Wei Shen