开发者

Regex to change last 2 numbers in set of 6 on condition

开发者 https://www.devze.com 2023-03-25 01:41 出处:网络
This number is in a filename string eg. abcdefg-sdasdfg-123开发者_如何转开发410.txt I am using an application which is changing the filename and can use regex.

This number is in a filename string eg. abcdefg-sdasdfg-123开发者_如何转开发410.txt I am using an application which is changing the filename and can use regex. If there is a number at the end of the filename, such as 123410, I need to change the last 2 digits so it will be 123411.


Depending on which regex variant you're using, try something like this:

Search for: (.*)10(\..*)
Replace with: ${1}11${2}


Using Notepad++:

Find what: ([0-9]+)[0-9][0-9].
Replace with: \111.
0

精彩评论

暂无评论...
验证码 换一张
取 消