I want to delete lang-code(EN/DE/FR/IT/JA/ES) out of a string but i dont know the right expression can someone help me ? the Lang-code string always starts with EN/ and the end is variable i know i can delete this with preg_match but i diddnt understand the regex expressions... my code so far:
$string = 'some string EN/DE/FR/IT/JA/ES some string'
$new_string = preg_match('/ - (.*?)/', $string, $match);
$final_string = str_replace ($match[1], '', $new_string);
$final_string should return 'some string some string' does someone know the right expression for preg_match and can help me to understand regex a little more?