Extract file name from a path using regular expression

后端 未结 2 1055
小蘑菇
小蘑菇 2020-12-10 00:24

How can I extract the string \"XMLFileName\" from the below URL using regular expression

var x = \"C:\\Documents and Settings\\Dig\\Desktop\\XMLFileName.xm         


        
2条回答
  •  渐次进展
    2020-12-10 00:44

    You can use: "[^\\]*$"

    but why not using regular javascript functions like indexOf() etc.

提交回复
热议问题