开发者

Regex to match all characters before file extension

I'm using this Windows a开发者_如何学Cpplication to batch rename a bunch of images. The application supports Regex, so I'm looking for an expression that will match everything (letters, numbers, hyphens, anything) before my file extension.

Thanks!


Not quite enough information given in the question, but this is probably what you want:

([^/\\]+)(\.[^/\\]+?)?

The first capture group will contain your file's basename and the second capture group will contain the extension, including the '.' character, if it exists.

You can reference the two capture groups in the 'Replace' section with $1 and $2.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜