This is my string:
Versandkosten (Versand - Kosten)(innerhalb Deutschlands)
I want to replace the first part in parentheses, so after replacing it should look like that:
Versandkosten (innerhalb Deutschlands)
The first part is not always the same, but its always this pattern: (something - something).
This is what I tried, but it always replaces everything:
$title = 'Versandkosten (Versand - Kosten)(innerhalb Deutschlands)';
$title = preg_replace('/\(.+[-].+\)/', '', $title);
Thanks for helping!
[a-zA-Z ]. Complete with any sign that might be contained in the name, or use\w. The important part is that it doesn't contain(or). As dots means "any character" in regex,(is considered valid and is captured in your regexVersandkosten (Versand)(innerhalb Deutschlands)what output do you expect?