これが私の正規表現のために持っているものです。これが最善の方法であるかどうか疑問に思っていました。
識別子の間隔に関係なく、大文字と小文字を区別せずに、類似したものを見つけられるようにしたいと考えています。そして、可能であれば、順序について心配する必要はありません..
例:
[Foreclosure ="Remax" URL="http://www.remax.com" Title = "4 Bedroom 2 Bath Condo"]
[Foreclosure ="Remax"URL="http://www.remax.com"Title="4 Bedroom 2 Bath Condo"]
[Foreclosure = "Remax" URL="http://www.remax.com" Title = "4 Bedroom 2 Bath Condo" ]
これが私の既存のコードです:
function ForeclosureCode_filter( $buffer )
{
//There might be a better way to do the regex... But this seems to work...
$buffer = preg_replace_callback( '@\[Forclosure *=*"(.*?)" *url *=*"(.*?)" *title="(.*?)" *\]@si',
"ForeclosureCode_replace", $buffer );
return $buffer;
}