How to remove everything after first dot or full stop (.) from the file name

The Demo file name is
I want to remove. This part of. the File name.jpg
The Target file name is
I want to remove
How to Remove everything after the first dot or Full Stop (.) from the Selected File names only

I know the forum role is I can ask only 1 Question in 1 post
But I will Need a 2nd and 3rd solution where I have to asked
How to Remove everything after the 2nd dot or Full Stop (.) from the Selected File names only
How to Remove everything after the 3rd dot or Full Stop (.) from the Selected File names only

Using regex:

From ([^.]+)
To: \1

To explain:

  • [^.] means any character that is not a dot.

  • + means 1 or more copies of whatever came before the +.

  • So [^.]+ means one or more characters which are not a dot, and it will grab as many characters as it can before either the first dot or the end of the string.

  • Placing ( ) around that allows you to "capture" whatever is matched, so that you can insert it into the result using \1, which inserts the first captured text.

From ([^.]+\.[^.]+)
To: \1

From ([^.]+\.[^.]+\.[^.]+)
To: \1

Regex may look daunting at first, but they're built up from lots of simple parts and a few easy to learn rules. If you're doing a lot of renaming, as you seem to be, then it's worth learning how regex work. Regex are well documented, and have lots of tutorials on the web (including a basic one here in the Rename Presets area).

1 Like

Thanks for the Explain