The standard regex is ^[\s]*([\w]+\s?:[\s]*)+ and we use only the smart matching. Primary to avoid another tracking number in the subject. 

In many circumstances we have a tracking number from an external system and therefore the subject is changed. 

Ex. standard this will be the initial subject:

"This is a test subject send from Dynamics"

Then a normal process is that the customer reply, forward etc. Then the subject is changed to "RE: This is a test subject send from Dynamics". The regex will remove the RE: and the email are matched. 

However if the subject goes through our case handling system the subject will be changed to something like: "This is a test subject send from Dynamics [Case#423423]"

How can i modify the regex so it both removes the "RE:" etc in the beginning and remove the [Case#423423] from the subject. Please note that the number 23423 is different each time. So i imagine it should use the brackets and Case# to identify it. So maybe remove everything from "[Case#" to "]"

Can this be done and will it work if i replace the new regex in dynamics email settings