Change:
assert.strictEqual(result, '2.test.js'); }); <ins> test('Increment file name with prefix version - check if starting from digit', function () { const name = 'F1.test.js'; const result = incrementFileName(name, false); assert.strictEqual(result, 'F1.test.1.js'); }); </ins> test('Increment file name with just version in name', function () { const name = '1.js'; const result = incrementFileName(name, false); assert.strictEqual(result, '2.js'); }); <ins> test('Increment file name with just version in name - check if starting from digit', function () { const name = 'F1.js'; const result = incrementFileName(name, false); assert.strictEqual(result, 'F1.1.js'); }); </ins> test('Increment file name with just version in name, too big number', function () { const name = '9007199254740992.js'; const result = incrementFileName(name, false);

Discussion:
Issue Type: <bBug</bI have a file named F1000-v117.au3. When copying/pasting the file, it creates a file named F1001-v117.au3. This is not the expected result. F1000 is the name of the file and not a version number that should be incremented. Changing the regex within the incrementFileName function fixes the issue. Basically, make sure the first section of the file name is numeric only. to VS Code version: Code 1.25.1 (, 2018-07-11T15:43:11.471Z) OS version: WindowsNT ia32 6.1.7601 <details<summarySystem Info</summary </details<!-- generated by issue reporter --
PR for this is welcome It would be great if the PR contains a unit test fyi
I'll take a look tomorrow.
is the expected result right?
Actually it seems like other cases are broken now. Have a file , copy and paste it The new file is , in 1.26 it was
Thanks for finding that Due to that I had to revert the original fix. So now copying gives However this issue is now not fixed, but it was like that in previous stable so nothing urgent -removing mielstone let me know if you want to fix your fix and provide a working PR. Thanks
Hey guys, I took a crack at fixing this regex have some questions on how the naming / number schema works and I want to make sure I have an understanding of the naming schema. We have our cases here: suffix: prefix: single number: no number: ends with number: mixed (new case / why the above PR broke): prefixed with number: The issue is that mixing letters and numbers triggers the prefix regex which incorrectly increments the number. But all the different variations of prefix / suffix and single number / mixed with letters make this particularly tricky. It seems like edits need to be made to existing regexes to ensure that they are matching digit only groups. However, the above PR regex edits and the edits I've made consistently break other regexes. Any ideas or considerations here?

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details . If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider. If you wonder what we are up to, please see our and guidelines. Thanks for your understanding and happy coding!