我有這種格式的字符串,我從這個string.The問題只想the-big-bang-theory
在這個字符串有些話是可變長度刪除啓動字和結尾的單詞正則表達式
media-tv-quotes-2-the-big-bang-theory-94-toprated-2
^ ^^ ^
----------------------------------------------------
我試圖用這個的代碼但沒有運氣。
$keywords = str_replace("/media-[a-z]-quotes-+/","", "media-tv-quotes-2-the-big-bang-theory-94-toprated-2");
有人知道我該怎麼做到這一點。
謝謝..
您不能對正則表達式使用'str_replace'。使用'preg_replace'。 –
是你想從第一個數字到第二個數字的邏輯嗎? – Matthew
我也試過,但也沒有運氣.. –