Re: [工具] TriBalWars Tool V 0.1
看板TribalWars (Tribal Wars)作者sss2500 (Silence X.- 繁星舞兮)時間18年前 (2007/09/18 08:15)推噓1(1推 0噓 0→)留言1則, 1人參與討論串6/6 (看更多)
關於regular expression處理座標的問題,剛剛花了一點時間弄出來了。
因為對js還不熟,所以我還是用php來處理re的問題。
結論是,不管座標(xxx|yyy)擺在哪裡,都可以直接抓出來。
網頁著色版本: http://rafb.net/p/4OxjZD13.html //懶的在BBS上著色了( ̄▽ ̄#
----------------------------以下是顯示結果-----------------------------
Array ( [0] => Array ( [0] => 688|632 [1] => 689|632 [2] => 690|633 [3] =>
690|633 ) )
Array ( [0] => 688|632 )
----------------------------以下是原始碼-----------------------------
<?
$str='Darthswab..s "/*-+!@#$%^&*()village (688|632) K66emaster65s village
(689|632) K66llage (690|633) K66 llage (690|633)';
$str=htmlspecialchars($str);
//preg_match_all — Perform a global regular expression match
//int preg_match_all ( string $pattern, string $subject, array &$matches [,
int $flags [, int $offset]] )
//http://tw.php.net/manual/en/function.preg-match-all.php
preg_match_all("/\d\d\d\|\d\d\d/s", $str, $matches);
print_r($matches);
echo "<br>" ;
//preg_match — Perform a regular expression match
//int preg_match ( string $pattern, string $subject [, array &$matches [,
int $flags [, int $offset]]] )
//http://tw.php.net/manual/en/function.preg-match.php
preg_match("/\d\d\d\|\d\d\d/s", $str, $matches);
print_r($matches);
?>
--
以上
--
╭═╖╭★╖╭═╖
╰★╮╰═╮╰★╮ [繁星舞兮][千星萬曜:星耀尋夢旅途~] ∮
╘═╯╘═╯╘═╯
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.104.231.174
推
09/18 19:03, , 1F
09/18 19:03, 1F
討論串 (同標題文章)
完整討論串 (本文為第 6 之 6 篇):
TribalWars 近期熱門文章
PTT遊戲區 即時熱門文章
22
33