2012-05-09 78 views

回答

0

,我在PHP想出了正則表達式是:

$s = ',,[[,2thesecretoflife'; 
$r = preg_match('/^,,\\[\\[,2/', $s); 

if ($r) { 
    echo 'works'; 
} 

基本上,你必須仔細逃脫[ s到讓他們得到適當的解釋。我相信你使用的任何語言都是相似的。

+0

謝謝vansimke。但使用preg_match它給了我這個。警告:preg_match():在 – hydef

+0

中找不到結尾分隔符'^'請我急需這個..help我 – hydef

+0

試試這個版本。 preg_match顯然需要用'/'包圍模式。鏈接到PHP文檔:http://us3.php.net/manual/en/function.preg-match.php – vansimke