const str = 'smb://10.1.226.178/平台/audio/smbtest/' const reg = /([^:]+):\/\/([^\/]+)(\S*)/ console.log(str.match(reg)) //[str, "smb", "10.1.226.178", "/平台/audio/smbtest/"]