js正则 replace and RegExp
发布日期: 2021-01-25 00:00:00
点击次数: 1921
点击次数: 1921
大字
小字
var proname = 'proname '
'<link rel="stylesheet" href="/asset/reward/common/base.css?v=fdsafdsa432432">432423'.replace(
new RegExp(
'(<link[^<>]*href="/asset/' +
proname +
'/common/base.css)(\\?v=)(\\w+)">',
'gi'
),
``
)
'<link rel="stylesheet" href="/asset/reward/common/base.css?v=fdsafdsa432432">432423'.replace(
new RegExp(
'(<link[^<>]*href="/asset/' +
proname +
'/common/base.css)(\\?v=)(\\w+)">',
'gi'
),
``
)