我需要一种方法在“h1”之后选择“h1”所有内容,使用正则表达式将其替换为空。我还需要它为@import工作。
我需要改变这个:
<link href='http://fonts.googleapis.com/css?family=Special+Elite' rel='stylesheet' type='text/css'>
h1 { font-family: 'Special Elite', arial, serif; }
@import url(http://fonts.googleapis.com/css?family=Special+Elite);
<link href='http://fonts.googleapis.com/css?family=Quattrocento+Sans' rel='stylesheet' type='text/css'>
h1 { font-family: 'Quattrocento Sans', arial, serif; }
@import url(http://fonts.googleapis.com/css?family=Quattrocento+Sans);
<link href='http://fonts.googleapis.com/css?family=Smythe' rel='stylesheet' type='text/css'>
h1 { font-family: 'Smythe', arial, serif; }
@import url(http://fonts.googleapis.com/css?family=Smythe);
对此:
<link href='http://fonts.googleapis.com/css?family=Special+Elite' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Quattrocento+Sans' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Smythe' rel='stylesheet' type='text/css'>