<div class="gmail_quote">On 10 August 2010 09:24, Bináris <span dir="ltr"><<a href="mailto:wikiposta@gmail.com">wikiposta@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
All the "0" chars in titles mean "any digit". As far as I see, move.py does not handle regexps in the way replace.py does, although I would just need this feature. <br><br>How would you solve this problem? <br>
<br></blockquote><div><br></div><div>Use the framework instead of relying ready-to-use bots. Use the PrefixingPageGenerator combined with the RegexFilterPageGenerator (from pagegenerators.py) to yield the correct pages to move. Something like:</div>
<div><br></div><div><div><div>>>> gen = RegexFilterPageGenerator(PrefixingPageGenerator("kkStB"), r"kkStB [0-9][0-9]?[0-9]?")</div><div>>>> for page in gen:</div><div>... print page</div>
<div>...</div><div>[[KkStB 1]]</div><div>[[KkStB 10]]</div><div>[[KkStB 105]]</div><div>[[KkStB 106]]</div><div>[[KkStB 108]]</div><div>[[KkStB 110]]</div><div>[[KkStB 110.500]]</div><div>[[KkStB 129]]</div><div>[[KkStB 14]]</div>
<div>[[KkStB 151]]</div><div>[[KkStB 166]]</div><div>[[KkStB 17]]</div><div>[[KkStB 179]]</div><div>[[KkStB 180]]</div><div>[[KkStB 180.500]]</div><div>[[KkStB 205]]</div><div>[[KkStB 206]]</div><div>[[KkStB 207]]</div><div>
[[KkStB 210]]</div><div>[[KkStB 211]]</div><div>[[KkStB 229]]</div><div>[[KkStB 231]]</div><div>[[KkStB 27]]</div><div>[[KkStB 270]]</div><div>[[KkStB 306]]</div><div>[[KkStB 31.01–11]]</div><div>[[KkStB 310]]</div><div>
[[KkStB 310.300]]</div>
<div>[[KkStB 32]]</div><div>[[KkStB 329]]</div><div>[[KkStB 378]]</div><div>[[KkStB 393]]</div><div>[[KkStB 4]]</div><div>[[KkStB 406]]</div><div>[[KkStB 46]]</div><div>[[KkStB 5]]</div><div>[[KkStB 506]]</div><div>[[KkStB 571]]</div>
<div>[[KkStB 6]]</div><div>[[KkStB 60]]</div><div>[[KkStB 7]]</div><div>[[KkStB 76 sorozatú szerkocsi]]</div></div></div><div><br></div><div><br></div><div>of course, adapt the regexp to create a slightly better filter. These pages can then be moved using the move(newtitle) method of the page object.</div>
<div><br></div><div>Best regards,</div><div>Merlijn</div><div><br></div></div>