SOURCE

const patt = /url\((.*)\)/g
const str = `h1{
  color: red;
  background: url(./assets/n1.png);
}
h2{
     color: red;
  background: url(./assets/n2.png);
}
`

while ((result = patt.exec(str)) != null)  {
  console.log(result[1])
 }
console 命令行工具 X clear

                    
>
console