What regular expression in php to use?

Good day dear experts! I would like to ask you a question about regular expressions.
Don't quite understand how to implement the removal of unnecessary to me characters.
I have the code:
$str = substr($filename, strlen('Subject(*)'));
I have the files:
1. Subject(Fwd_ CASTORLAND Price list September 2016)Preis Castorland September 2016!!!NEW+Darts!!!1.xlsx
2. Subject(Fwd_ of Atberg 98, price)Preis from 12.09.16.xls
....
I write something like strlen('Subject(*)'), but only deletes the first bracket and the first letter. How do I delete all what's inside the parentheses together with the Subject.
Example:
Was: Subject(Fwd_ of Atberg 98, price)Preis from 12.09.16.xls
Was Price from 12.09.16.xls
And that, even after the brackets (last) retired symbol _
Thank you very much for the help!
July 4th 19 at 23:10
1 answer
July 4th 19 at 23:12
Solution
Good day.

As for me, so here's what might work:
preg_replace('/Subject\(.*\)_/i', ", $str); // where $str is the name of the file
/\((.+\)_).+/, i to anything in principle - robbie_Macejkovic62 commented on July 4th 19 at 23:15
I have an array of these files, so did this
$str = preg_replace('/mailfile\/Subject\(.*\)_/i', ", $filename);

in the beginning there is a directory... I was able to stick to Your decision! Thank you very much for the help! - Carter commented on July 4th 19 at 23:18
: Glad to help! - ursula_Corwin86 commented on July 4th 19 at 23:21

Find more questions by tags PHPRegular expressionsWeb Development