Cake Your Government! How You Can Supply Mom (Mutti Merkel) With a New Partner

How You – YES, YOU! – Can Supply Mom (Mutti Merkel) With a New Partner

We’ll try to create an automatic process to generate a government for Merry Old Germany. The given possible data are:

if

Mutti

try

Mutti-ESPDEE

else

Mutti-Grüne

Mutti-Linkspartei

Minderheitsregierung

Duldung

wechselnde Mehrheiten

Neuwahlen

In order to discard all scenarios which are obviously impossible, e. g. MuttiLinkspartei, you must FILL the space between two bars with the unswallowable partner or a disallowed case/constellation:
|Linkspartei|Duldung|
ec. Also any punctuation mark like blank space ec.

Code:

<?php $government = 'Mutti-ESPDEE Grüne Linkspartei Minderheitsregierung Duldung wechselnde Mehrheiten Neuwahlen'; echo preg_replace('#(ESPDEE|Linkspartei|Minderheitsregierung|Duldung|wechselnde Mehrheiten|Neuwahlen|
|)#','', $government); ?>

This outputs the following: Mutti-Grüne