CityRay/Blog

[JS] Regular Expression

CityRay opened this issue · 0 comments

Regular Expression (正規表達式)

  • 移除 <script> tag 及內容
    text.replace(/<(script).*?>[\s\S]*?<\/\1>/ig, 'dangerous');