正規表現パターンはダブルクオーテーションで囲った文字列と同じように扱われるため、ダブルクオーテーションで囲われた文字列の中に変数を記述した場合と同じくパターン内に変数を記述した場合は変数展開が行われます。ここでは Perl の正規表現でパターン内での変数展開について解説します。
![パターン内での変数展開](https://cdn-ak-scissors.b.st-hatena.com/image/square/f54dfd986ba9650ac22544fd73c0f86160af401d/height=288;version=1;width=512/https%3A%2F%2Fwww.javadrive.jp%2Fperl%2Fregex%2Fimg%2Fp30-0.png)
正規表現パターンはダブルクオーテーションで囲った文字列と同じように扱われるため、ダブルクオーテーションで囲われた文字列の中に変数を記述した場合と同じくパターン内に変数を記述した場合は変数展開が行われます。ここでは Perl の正規表現でパターン内での変数展開について解説します。
まえがき 月別アーカイブリストを表示するタグ『wp_get_archives()』には引数に「before」と「after」が用意されていて好きな文字列をリンク文字の前後に入れることが可能ですが、カテゴリ別アーカイブリストを表示するタグ『wp_list_categories()』には何故か「before」と「after」が用意されておらず、好きな文字列を入れることが出来ません。どうしてさ!!! そんな『wp_list_categories()』ですが、function.phpにコードを追加するだけで「before」「after」と同じような設定を行うことが可能になります。 『wp_list_categories()』に「before」「after」を設定し文字列を追加する function.phpに以下のコードを追加します。 add_filter ( 'wp_list_categories
CompanyEngineeringProductSunsetting AtomWe are archiving Atom and all projects under the Atom organization for an official sunset on December 15, 2022. January 30, 2023 Update: Update to the previous version of Atom before February 2 On December 7, 2022, GitHub detected unauthorized access to a set of repositories used in the planning and development of Atom. After a thorough investigation, we hav
Creating the possibilities of humans and society, Like sports. CEO Dai Tamesue 人間と社会の可能性を拓く、 スポーツのように。 タイムというはっきりとした結果が出る競技を追求しながら、人間の限界はどこにあるのだろうかと考え続けてきました。伸び悩んだり、重圧に苦しんだりする中で、限界は自分自身の思い込みが作っているのではないかと、そう思うようになりました。 社会を見渡せばそんな出来事が溢れています。思い込みによって制約がかかり可能性が狭まっている。自分がスポーツと向き合ってきた方法が、人間と社会の可能性を拓く上で活かせるのではないかと思い、会社を始めました。 私は「スポーツとは身体と環境の間で遊ぶこと」だと定義しています。遊びには計画も、義務もありません。面白いから行われる自由な活動です。そんな「遊ぶ」という感覚が
CompanyEngineeringProductSunsetting AtomWe are archiving Atom and all projects under the Atom organization for an official sunset on December 15, 2022. January 30, 2023 Update: Update to the previous version of Atom before February 2 On December 7, 2022, GitHub detected unauthorized access to a set of repositories used in the planning and development of Atom. After a thorough investigation, we hav
CompanyEngineeringProductSunsetting AtomWe are archiving Atom and all projects under the Atom organization for an official sunset on December 15, 2022. January 30, 2023 Update: Update to the previous version of Atom before February 2 On December 7, 2022, GitHub detected unauthorized access to a set of repositories used in the planning and development of Atom. After a thorough investigation, we hav
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く