Since AWB already merges {{for}} and {{about}}, would it make sense to also include {{other uses}} into this merging? I could come up with some logic if you're interested. @GoingBatty 06:39, 30 December 2013 (UTC)
Description
Description
Event Timeline
Comment Actions
@Magioladitis 07:33, 30 December 2013 (UTC) wrote:
@GoingBatty I would be interested. What are the rules?
@GoingBatty 04:03, 31 December 2013 (UTC) wrote:
@Magioladitis - Here's a start on the logic, but it's too greedy (i.e. if {{tl|for}} has more than three parameters, such as https://en.wikipedia.org/wiki/Systematics:
<source lang="C"> <Replacement> <Find>{{for\s*?\|(.*?)\|(.*?)\|(.*?)}}\s*{{other uses\s*\|(.*?)}}</Find> <Replace>{{about||$1|$2|and|$3|other uses|$4}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{for\s*?\|(.*?)\|(.*?)}}\s*{{other uses\s*\|(.*?)}}</Find> <Replace>{{about||$1|$2|other uses|$3}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{for\s*?\|(.*?)\|(.*?)\|(.*?)}}\s*{{other uses}}</Find> <Replace>{{about||$1|$2|and|$3|other uses}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{for\s*?\|(.*?)\|(.*?)}}\s*{{other uses}}</Find> <Replace>{{about||$1|$2|other uses}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{other uses\s*\|(.*?)}}\s*{{for\s*?\|(.*?)\|(.*?)\|(.*?)}}</Find> <Replace>{{about||$2|$3|and|$4|other uses|$1}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{other uses\s*\|(.*?)}}\s*{{for\s*?\|(.*?)\|(.*?)}}</Find> <Replace>{{about||$2|$3|other uses|$1}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{other uses}}\s*{{for\s*?\|(.*?)\|(.*?)\|(.*?)}}</Find> <Replace>{{about||$1|$2|and|$3|other uses}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{other uses}}\s*{{for\s*?\|(.*?)\|(.*?)}}</Find> <Replace>{{about||$1|$2|other uses}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{about\s*?\|(.*?)\|(.*?)\|(.*?)}}\s*{{other uses\s*\|(.*?)}}</Find> <Replace>{{about|$1|$2|$3|other uses|$4}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{about\s*?\|(.*?)\|(.*?)\|(.*?)}}\s*{{other uses}}</Find> <Replace>{{about|$1|$2|$3|other uses}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{other uses\s*\|(.*?)}}\s*{{about\s*?\|(.*?)\|(.*?)\|(.*?)}}</Find> <Replace>{{about|$2|$3|$4|other uses|$1}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> <Replacement> <Find>{{other uses}}\s*{{about\s*?\|(.*?)\|(.*?)\|(.*?)}}</Find> <Replace>{{about|$1|$2|$3|other uses}}</Replace> <Comment /> <IsRegex>true</IsRegex> <Enabled>true</Enabled> <Minor>false</Minor> <BeforeOrAfter>true</BeforeOrAfter> <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions> </Replacement> </source>
Thanks for your consideration!