[PATCH] make ksnapshot increment the last number

Thiago Macieira thiago at kde.org
Sun Oct 7 15:48:50 BST 2007


David Jarvie wrote:
>On Sunday 07 October 2007 06:19:35 Hoàng Đức Hiếu wrote:
>>   Hi,
>>
>>  My previous patch has a problem, it only matches the last digit in
>> the filename, so "snapshot19.png" is followed by "snapshot110.png".
>> amrit on #qt suggested using "[^\\d](\\d+)" to match as far to the
>> left as possible. This regexp doesn't match when the only number is at
>> the start of the filename, so I used a second regexp to match that
>> case.
>
>How about "[^\\d]?(\\d+)" to cover both cases?

"(^|[^\\d])(\\d+)"

and change the match to the second group.
-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071007/b068c427/attachment.sig>


More information about the kde-core-devel mailing list