Terminating bracket is lost in renaming process

All your suggestions, requests and ideas for future development
Post Reply
beamer145
Posts: 17
Joined: 27 Jan 2013, 01:30

Terminating bracket is lost in renaming process

Post by beamer145 »

Hi,

I recently noticed that if a field (eg group) has xxxx[yyy] in the source name, the end result will be xxxx[yyy (so without the ending ])
Problable some interference with it being a regex symbol ?
Version 4.7.9
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Terminating bracket is lost in renaming process

Post by kim »

What is your format ?

using {group} should only result in "xxxx" OR "yyy"
beamer145
Posts: 17
Joined: 27 Jan 2013, 01:30

Re: Terminating bracket is lost in renaming process

Post by beamer145 »

My complete format string is
{n}.{s00e00}.{t}.{vc}.{ac}{".$group"}{".$lang"}{fn.match(/[.]HI(?\=\\.)/)}{fn.match(/[.]HI$/)}

(can't say i remember why i prefixed with .$ , it's 4 years ago that i made this and i do not know the syntax anymore)

An generic example that has the problem would look like
aaaaaaaaaaaa.SbbEcc.HDTV.x264-XXX[yyyy].mkv
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Terminating bracket is lost in renaming process

Post by kim »

I can't reproduce the problem
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Terminating bracket is lost in renaming process

Post by rednoah »

There's a good chance that this particular issue has been fixed with one of the more recent updates.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Terminating bracket is lost in renaming process

Post by kim »

xxxx[yyy] it wrong anyway so:
GROUP[NOT GROUP but site Who Shared It]
then you can do something like:

Code: Select all

{group.replaceAll(/\[.+\]?/,'')}
or if you REALLY want the ]

Code: Select all

{group.match(/\[/) ? group+']' : group}

Code: Select all

{group.match(/\[/) && !group.contains(/\]/) ? group+']' : group}
beamer145
Posts: 17
Joined: 27 Jan 2013, 01:30

Re: Terminating bracket is lost in renaming process

Post by beamer145 »

Great, thanks for the tips !

I am indeed not really interested in the [ ] part, so i decided to go for

Code: Select all

{n}.{s00e00}.{t}.{vc}.{ac}{".${group.replaceAll(/\[.+\]?/,'')}"}{".$lang"}{fn.match(/[.]HI(?\=\\.)/)}{fn.match(/[.]HI$/)}
Post Reply