The problem of regular expressions

/Desktop/Web/node/we_expert/static/upload/common/....

there is such a string. I want to remove the content before static and leave / upload/common/.
how to write regular

.

all of Baidu"s answers are not the questions asked.

Mar.22,2021

Brother you can actually do this without regularization. First, you convert the string to an array through the string .split (/), and then for (var i the array to 0; I < 2; I PP) array .pop () because pop returns deleted numbers, you can create a new array to receive,



let reg=/\S+static(\S+)/ //
let str='/Desktop/Web/node/we_expert/static/upload/common' //
console.log(reg.exec(str)[1])

'/ Desktop/Web/node/we_expert/static/upload/common/.'.match (/ (/ staticS+) /) [0]

Menu