2020年02月28日 更新
「TS」関連の最新Q&A、口コミを取得してご利用ください。

取得対象: 「はてな人力検索」、「教えて!goo」、「Yahoo!知恵袋」、「OKWave」、「livedoorナレッジ」

TS
をクリック・・・その記事と関連のあるQ&Aを一覧表示できます。


PHP・正規表現でいくつかのフォーマットから住所を抜き出したく、そのコードを教えてください。 ーーー <パターンA> ■住所 東京都渋谷区渋谷1-1-1 <パターンB> 住所:東京都渋谷区渋谷1-1-1 <パターンC> 住所 東京都渋谷区渋谷1-1-1 ーーー ※住所が「所在地」「場所」の場合もある。 途中まで考えてみたのは以下のとおりです。 $post_code= "【該当のページのソースコード】" $contents = strip_tags($post_code);//タグ除去 $contents = preg_replace('/所在地(\n|\r|\r\n)/', '所在地', $contents);//住所と所在地で見出しのあとに改行がある場合は削除 $contents = preg_replace('/住所(\n|\r|\r\n)/', '住所', $contents); preg_match('/(住所|所在地)(.+)\n/', $contents, $match);//住所と所在地がある行の住所部分を抜き出す $text = $match[2]; $text = str_replace(':', '', $text);//住所に「:」とかあれば除く $text = str_replace(':', '', $text); $text = str_replace(' ', '', $text); $text = str_replace(' ', '', $text); URLは不要ですのでご教示いただけましたら幸いです。 ...


The next Clasico, which is the second of the 2019-20 season, will be played at Santiago Bernabeu on March 1, 2020. La Liga El Clasico 2020 has announced that at 8 pm UK time (3 pm US ET) it will be an evening match with kick-off. At the time of writing, Real Madrid and Barcelona sit on top of LaLiga on the same number of points (40) with 19 games played at the halfway stage of the season. The first Liga Clasico in the 2019-20 https://elclasico2020.live campaign between Barcelona and Real Madrid – originally set to be played on October 26 – was postponed and rescheduled for December 18 following the region's political unrest. ...


The next Clasico, which is the second of the 2019-20 season, will be played at Santiago Bernabeu on March 1, 2020. La Liga El Clasico 2020 has announced that at 8 pm UK time (3 pm US ET) it will be an evening match with kick-off. At the time of writing, Real Madrid and Barcelona sit on top of LaLiga on the same number of points (40) with 19 games played at the halfway stage of the season. The first Liga Clasico in the 2019-20 https://elclasico2020.live campaign between Barcelona and Real Madrid – originally set to be played on October 26 – was postponed and rescheduled for December 18 following the region's political unrest. ...


The next Clasico, which is the second of the 2019-20 season, will be played at Santiago Bernabeu on March 1, 2020. La Liga El Clasico 2020 has announced that at 8 pm UK time (3 pm US ET) it will be an evening match with kick-off. At the time of writing, Real Madrid and Barcelona sit on top of LaLiga on the same number of points (40) with 19 games played at the halfway stage of the season. The first Liga Clasico in the 2019-20 https://elclasico2020.live campaign between Barcelona and Real Madrid – originally set to be played on October 26 – was postponed and rescheduled for December 18 following the region's political unrest. ...


The next Clasico, which is the second of the 2019-20 season, will be played at Santiago Bernabeu on March 1, 2020. La Liga El Clasico 2020 has announced that at 8 pm UK time (3 pm US ET) it will be an evening match with kick-off. At the time of writing, Real Madrid and Barcelona sit on top of LaLiga on the same number of points (40) with 19 games played at the halfway stage of the season. The first Liga Clasico in the 2019-20 https://elclasico2020.live campaign between Barcelona and Real Madrid – originally set to be played on October 26 – was postponed and rescheduled for December 18 following the region's political unrest. ...