[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [PATCH] make ksnapshot increment the last number
From:       Thiago Macieira <thiago () kde ! org>
Date:       2007-10-07 14:48:50
Message-ID: 200710071648.50375.thiago () kde ! org
[Download RAW message or body]


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

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic