MT Regex - ikoaoki/mt-migration GitHub Wiki
正規表現が使えるようになるプラグイン。
MTクラウドでは動作しない。
<MTRegexDefine name="toph">s|トフ|<img src="/icon/toph.gif">|g</MTRegexDefine>
<MTEntries>
<MTEntryBody regex="toph">
</MTEntries>
<MTEntryBody regex_replace="/トフ/g","<img src="/icon/toph.png">">
<MTUnless regex_replace="/トフ/g","<img src="/icon/toph.png">">
<MTEntries>
<MTEntryTitle>
<MTEntryBody>
</MTEntries>
</MTUnless>
<MTRegexDefine name="pattern1">s|トフ|<strong>トフは可愛い</strong>|g</MTRegexDefine>
<MTRegexDefine name="pattern2">s|\[google\]|<a href="http://www.google.co.jp/">[Google]</a>|g</MTRegexDefine>
<MTEntries regex="pattern1 pattern2">
<MTEntryTitle>
<MTEntryBody>
</MTEntries>
<MTUnless
regex_replace="/トフ/g","<strong>トフは可愛い</strong>"
regex_replace="/google/g","<a href="http://www.google.co.jp/">[Google]</a>"
>
<MTEntries>
<MTEntryTitle>
<MTEntryBody>
</MTEntries>
</MTUnless>
<MTEntries>
<MTIfMatches pattern="m/インコ/">
<MTEntryBody>
</MTIfMatches>
</MTEntries>
<MTRegexDefine name="match1">m/インコ/</MTRegexDefine>
<MTEntries>
<MTIfMatches pattern="match1">
<MTEntryBody>
</MTIfMatches>
</MTEntries>
<MTEntries>
<MTIf tag="EntryBody" like="インコ">
<MTEntryBody>
</MTIf>
</MTEntries>
<MTEntries>
<MTSetVarBlock name="match1"><MTEntryBody></MTSetVarBlock>
<MTIf name="match1" like="インコ">
<MTEntryBody>
</MTIf>
</MTEntries>
<MTEntries>
<MTIfMatches var="EntryAuthor" pattern="m/bird/">
<MTEntryTitle>
</MTIfMatches>
</MTEntries>
<MTEntries>
<MTIfNotMatches var="EntryAuthor" pattern="m/(dog|cat)/i">
<MTEntryTitle>
</MTIfNotMatches>
</MTEntries>
<MTEntries author="bird">
<MTEntryTitle>
</MTEntries>
<MTEntries>
<MTIf tag="EntryAuthor" like="^(dog|cat)">
<MTEntryTitle>
</MTIf>
</MTEntries>
<MTEntries>
<MTIfNotMatches var="EntryAuthor" pattern="m/bird/">
<MTEntryTitle>
</MTIfNotMatches>
</MTEntries>
<MTEntries>
<MTIfNotMatches var="EntryAuthor" pattern="m/(dog|cat)/i">
<MTEntryTitle>
</MTIfNotMatches>
</MTEntries>
<MTEntries>
<MTUnless tag="EntryAuthor" eq="bird">
<MTEntryTitle>
</MTUnless>
</MTEntries>
<MTEntries>
<MTUnless tag="EntryAuthor" like="^(dog|cat)">
<MTEntryTitle>
</MTUnless>
</MTEntries>
<MTIfMatches var="BlogEntryCount" value="100">
当ブログは100記事を達成しました!
</MTIfMatches>
<MTIf tag="BlogEntryCount" eq="100">
当ブログは100記事を達成しました!
</MTIf>
<MTIf tag="BlogEntryCount" ge="100">
当ブログは100記事を達成しました!
<MTElse>
当ブログは100記事をまだ達成できてません…
</MTIf>