Change case except text in brackets?

Advanced Renamer forum
#1 : 28/03-18 09:03
Chris
Chris
Posts: 1
Hi, i want to changer my filename to uppercase but exclude all the text inside brackets.
eg. This is test (sample)
So i need This is test to change to upper case ane (sample) stay as it is.
How can i do this?
Thanks


28/03-18 09:03
#2 : 28/03-18 11:49
Stefan
Stefan
Posts: 274
Reply to #1:

FROM:
This is test (sample).ext
TO:
THIS IS TEST (sample).ext


Utilize New case method
https://www.advancedrenamer.com/user_guide/metho d_newcase

with option "Set pattern to upper case"

with an Regular Expression
"match one-or-more of any sign till first opening parenthesis"

- - - - - - - - -

TRY:

New case method
Set pattern to upper case
Pattern:   .+\(
☑ Use regular expressions checkbox is checked



- - -

For text after "(...)"-parenthesis, add another method but now with Pattern:   \).+


For more read
https://www.advancedrenamer.com/user_guide/regul ar_expresions




 


28/03-18 11:49 - edited 28/03-18 11:51
#3 : 28/03-18 12:36
Mark
Mark
Posts: 175
Reply to #2:
And maybe just to show what I've been learning from Stefan's RegEx posts :) .....

With This is test (sample).txt

Apply 2 New Case Methods

Method 1
Set upper case
Apply to Name

Gives THIS IS TEST (SAMPLE).txt

Method 2
Set pattern to lower case
Pattern: \(.*\)
Apply to Name

Gives THIS IS TEST (sample).txt

Only works properly with one set of ( ). If you have more, maybe Stefan can help with the RegEx!



28/03-18 12:36
#4 : 28/03-18 15:08
Stefan
Stefan
Posts: 274
Reply to #3:

Well done Mark, but...



Mark> Set pattern to lower case
Chris > and (sample) stay as it is

as maybe in:
This is test (Sample).ext ==> THIS IS TEST (Sample).ext





no offense :-) :thumbsup:


28/03-18 15:08
#5 : 28/03-18 16:13
Mark
Mark
Posts: 175
Reply to #4:
Ah! Good spot!

As they say, read the exam question ..... then read it again :)


28/03-18 16:13