[php] wyrażenia regularne

0

W jaki sposób poprawić scrypt żeby zwracało mi to co jest między

$TYP_START$ / $TYP_END$

czyli

<option%selected_typ%>%typ%</option>

<?
    $string = "$TYP_START$
                 <option%selected_typ%>%typ%</option>
                $TYP_END$";
    $result = array();
    preg_match_all('/%TYP_START%(.+?)%TYP_END%/', $string, $result);
    print_r($result);
?>
0
<? $string = '$TYP_START$ <option%selected_typ%>%typ%</option> $TYP_END$'; $result = array(); preg_match_all('/\$TYP_START\$(.+?)\$TYP_END\$/', $string, $result); print_r($result); ?>
0

deczko nie działa, też tak próbowałam bo w SPACJA końcu $ to znak specjalny. :(

0

zabrakło /s na końcu.

preg_match_all('/\$TYP_START\$(.+?)\$TYP_END\$/s', $string, $result);

s - dot matches new line

0

dziekie wielkie :)

1 użytkowników online, w tym zalogowanych: 0, gości: 1