preg-match-all

    -1熱度

    1回答

    如何在preg_match_all中創建正則表達式「和」? The mouse to nibble the cork from the bottle russia king. $n = preg_match_all("/cork&bottle/i", mb_strtolower($y['foo'], 'UTF-8'), $matches); /cork&bottle/i不工作

    1熱度

    1回答

    我有一個正則表達式,它檢查長度爲4到25個字符的用戶名,其後是任何可選的空格鍵和/或單個逗號。正如你可能已經猜到的,這是用於通過輸入諸如「用戶名1,用戶名2,用戶名3」之類的東西將個人消息發送給幾個人。 $rule = "%^\w{4,25}(+)?,?(+)?$%"; preg_match_all($rule, $sendto, $out); foreach($out[1] as $matc

    2熱度

    1回答

    我想要使用正則表達式來獲取所有YouTube iframe,並且想要爲找到的每個記錄添加特定的標記。 例如<youtube-frame></youtube-frame>以iframe begeing和結束。 所需輸出: <youtube-frame><iframe width="560" height="315" src="https://www.youtube.com/embed/vakfMRy

    1熱度

    1回答

    我有這樣的代碼: $query = 'CREATE table "msg" ("myid" INT(10) UNSIGNED , "user" INT(10) UNSIGNED , "new_mes" SMALLINT(5) UNSIGNED , "total_mes" MEDIUMINT(8) UNSIGNED , "lastdate" DATETIME , PRIMARY KEY ("ids"

    0熱度

    1回答

    preg_match_all('#\<td id=\"(.*)\" class=\"(.*)column(.*)\>(.*)\<\/td\>#i', $htmlcontent, $matches); $output = $htmlcontent; foreach ($matches[1] as $match) { echo $match.","; $ress

    0熱度

    3回答

    我已經返回一個preg_match來檢查起始數字是否爲9477或不是,它可以正常工作。但是現在我想添加另一個條件來添加9477或9476應該是有效的。 這裏的條件: 應包含11位數字 應與9477或9476 這裏開始是我的代碼: preg_match('/^9477\d{7}$/',$Mnumber)

    0熱度

    2回答

    我試圖找到一個可以出現在許多變化的大括號內的字符串。 即 以下字符串我在尋找這個詞鏈接 asdasd {Link1111:TAG} \ r \ n {TAG:Link2sds} 我使用下面的命令:$pattern = "/{(Link.*?)}|{(.*Link.*?)}/"; ,其結果是: {array} [3] 0 => {array} [2] 0 = "{Link1:TAG}"

    2熱度

    1回答

    我有一個preg_match_all功能與模式: preg_match_all( '/\[(if) ([^\]]*)\] ((?:(?!\[if).|(?R))*?) \[endif\]/sx', $text, $matches ); 這是很容易的圖案我猜測,它會尋找一個語法[if condition] sometext [endif],但它也

    0熱度

    3回答

    我試圖用正則表達式從字符串中提取一定值: 「exec_hash」: 「/ TPPE2ChB + 5HuSHs84FBgx5/EgWi0OlaEXoXq4pq3Aukhc1Ypf0mZfKCJ10w =」,「events_collector 「:」thiiM0ahsieSiech1phithe6chahngoo8sah6aid \ n「 我想要的數據是引號之間的散列。問題是該字符串中有多個引號,並且

    0熱度

    2回答

    我一直在使用preg_match_all從URL的地方我們可以使用GET方法獲取數據,但是如何使用POST方法獲取數據。 在我的情況下,我想從http://www.indianrail.gov.in/pnr_Enq.html(它是發佈數據的表單)獲取PNR詳細信息並獲取所有必需的詳細信息。我知道使用jQuery的表單發佈,但我怎樣才能在PHP中使用preg_match_all?