<?php
$regex = '~
_\[{2} # look for an underscore and two open square brackets
([^]]+) # capture anything that is not a closing bracket
\]{2}_ # followed by two closing square brackets and an underscore
~x'; # free space mode for this explanation
$string = "_[[2, verb//substantiv//adjektiv]]_";
# in the match replace [[(capture Group 1)]]
echo $new_string;
?>
PD9waHAKJHJlZ2V4ID0gJ34KICAgICAgICAgICAgICBfXFt7Mn0gICMgbG9vayBmb3IgYW4gdW5kZXJzY29yZSBhbmQgdHdvIG9wZW4gc3F1YXJlIGJyYWNrZXRzCiAgICAgICAgICAgICAgKFteXV0rKSAjIGNhcHR1cmUgYW55dGhpbmcgdGhhdCBpcyBub3QgYSBjbG9zaW5nIGJyYWNrZXQKICAgICAgICAgICAgICBcXXsyfV8gICMgZm9sbG93ZWQgYnkgdHdvIGNsb3Npbmcgc3F1YXJlIGJyYWNrZXRzIGFuZCBhbiB1bmRlcnNjb3JlCiAgICAgICAgICB+eCc7ICAgICAgICAjIGZyZWUgc3BhY2UgbW9kZSBmb3IgdGhpcyBleHBsYW5hdGlvbgokc3RyaW5nID0gIl9bWzIsIHZlcmIvL3N1YnN0YW50aXYvL2FkamVrdGl2XV1fIjsKCiRuZXdfc3RyaW5nID0gcHJlZ19yZXBsYWNlKCRyZWdleCwgIltbJDFdXSIsICRzdHJpbmcpOwojIGluIHRoZSBtYXRjaCByZXBsYWNlIFtbKGNhcHR1cmUgR3JvdXAgMSldXQplY2hvICRuZXdfc3RyaW5nOwo/Pg==