Sorry for doubling. Forgot about subject. Hello, can you help please hot to add/remove spaces in text For exmaple "J.R.R.Tolkien" should transform to "J. R. R. Tolkien" I tried to use replace.py and user-fixes.py (u' . ', u'. '), (u' ..?', u'. .?'), (u'.?..?', u'.?. .?'), But that's don't work. Hope on your help, thanks
This sounds like a negative lookahead test. I haven't tried it out, but I think:
(u'.(?!\s)', u'. ') or (if the second one shouldn't be a regular expression) (u'.(?!\s)', u'. ')
should work.
Andre Engels
On Mon, Aug 29, 2016 at 7:37 PM, Кирилл Хохлов kirill_9608@mail.ru wrote:
Sorry for doubling. Forgot about subject. Hello, can you help please hot to add/remove spaces in text For exmaple "J.R.R.Tolkien" should transform to "J. R. R. Tolkien" I tried to use replace.py and user-fixes.py (u' . ', u'. '), (u' ..?', u'. .?'), (u'.?..?', u'.?. .?'), But that's don't work. Hope on your help, thanks
-- Кирилл Хохлов/Kirill Khokhlov
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
I never use \ in the second expression (the replacement). It causes only trouble. Please detail what "that's don't work." means, so that we can help more.
2016-08-29 19:37 GMT+02:00 Кирилл Хохлов kirill_9608@mail.ru:
Sorry for doubling. Forgot about subject. Hello, can you help please hot to add/remove spaces in text For exmaple "J.R.R.Tolkien" should transform to "J. R. R. Tolkien" I tried to use replace.py and user-fixes.py (u' . ', u'. '), (u' ..?', u'. .?'), (u'.?..?', u'.?. .?'), But that's don't work. Hope on your help, thanks
-- Кирилл Хохлов/Kirill Khokhlov
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot