src\main\webapp\static\ca7ecd95-aa95-4da8-b369-92b66b566958\icon.png
I want to intercept the string starting from static. How should I write the regular expression? grateful
That is, static\ca7ecd95-aa95-4da8-b369-92b66b566958\icon.png
In addition, since the first half of the URL may change, it is best to use regular ones
split('static')[1] Is this the case? Or do I need to use regular rules?
str.slice(str.search(/static/));
You should use static.* for regular expressions. The following is the reference code
'srcmainwebappstaticca7ecd95-aa95-4da8-b369-92b66b566958icon.png'.split('static')[1]
Highlights of this question: