Regex: Get Filename Without Extension in One Shot?

后端 未结 7 1781
萌比男神i
萌比男神i 2020-12-03 03:20

I want to get just the filename using regex, so I\'ve been trying simple things like

([^\\.]*)

which of course work only if the filename ha

相关标签:
7条回答
  • how about 2 captures one for the end and one for the filename.

    eg.

    (.+?)(?:\.[^\.]*$|$)
    
    0 讨论(0)
提交回复
热议问题