Splunk Search

Can you help me build the regex that would extract a filename without filenamenumber and extension?

ugruner
Explorer

Hi,

i am not familiar with regex and am trying to extract only the filename from the following data without the number at the end:

myfile2.txt
myfileagain.doc
myfile33.txt

to

myfile
myfileagain
myfile

REGEX=(\bmy\w\D+) was my first idea, but I had no luck.

Can you give me a tip on how to solve this?

Regards
Udo

Tags (2)
0 Karma

FrankVl
Ultra Champion

Try something like this:
(?<filename>[a-zA-Z]+)\d*\.\w+

https://regex101.com/r/rAObpF/2

Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...