Page 1 of 1

RegExp pattern to remove the last x number of characters

Posted: 29 Mar 2023 06:42
by netizenk
What is the RegExp pattern to remove the last x number of characters?

With this one ^(....) > I can keep the last number of characters denoted by number of dots but no combinations of .* and parenthesis got me a result to keep all the characters in front and remove the number of last characters I need to...

BTW, is XY RegExp syntax documented anywhere? I couldn't find anything in the help file?

Re: RegExp pattern to remove the last x number of characters

Posted: 29 Mar 2023 06:46
by jupe
RegExp rename ?

files only:
(.*)(.{5})(\.[^.]+) > $1$3

The syntax is the same as vbscript regex, so google that.

Re: RegExp pattern to remove the last x number of characters

Posted: 29 Mar 2023 07:15
by netizenk
That worked great, appreciated.