Replace 将动态字符串替换为记事本++;

Replace 将动态字符串替换为记事本++;,replace,find,notepad++,Replace,Find,Notepad++,我有一个html页面,上面有href=“”标记列表,现在我正在使用angular,所以我需要找到并替换它到(单击)=“重定向到('myURL')”是否可以用记事本++来完成 例如: mypage.html <a href="home.html" class="myClass1 myClass2"> <a href="myProfile.html" class="myClass3 myClass4> <a href="aboutUs.html" class="myCl

我有一个html页面,上面有
href=“”
标记列表,现在我正在使用angular,所以我需要找到并替换它到
(单击)=“重定向到('myURL')”
是否可以用记事本++来完成

例如:

mypage.html

<a href="home.html" class="myClass1 myClass2">
<a href="myProfile.html" class="myClass3 myClass4>
<a href="aboutUs.html" class="myClass1 myClass2">
<a href="gallery.html" class="myClass3 myClass4>

希望将此代码替换为

<a (click)="redirectTo('home.html')" class="myClass1 myClass2">
<a (click)="redirectTo('myProfile.html')" class="myClass3 myClass4">
<a (click)="redirectTo('aboutUs.html')" class="myClass1 myClass2">
<a (click)="redirectTo('gallery.html')" class="myClass3 myClass4">
<a (click)="redirectTo('home.html')" class="myClass1 myClass2">
<a (click)="redirectTo('myProfile.html')" class="myClass3 myClass4>
<a (click)="redirectTo('aboutUs.html')" class="myClass1 myClass2">
<a (click)="redirectTo('gallery.html')" class="myClass3 myClass4>

  • Ctrl+H
  • 查找内容:
    href=“([^”]+)
  • 替换为:
    \(单击\)=“重定向到\”(“$1”)
    别忘了转义括号
  • 检查环绕
  • 检查正则表达式
  • 不要选中
    。匹配换行符
  • 全部替换
说明:

href="      : literally
(           : start group 1
  [^"]+     : 1 or more any character that is not a quote
)           : end group 1
给定示例的结果:

href="      : literally
(           : start group 1
  [^"]+     : 1 or more any character that is not a quote
)           : end group 1

  • Ctrl+H
  • 查找内容:
    href=“([^”]+)
  • 替换为:
    \(单击\)=“重定向到\”(“$1”)
    别忘了转义括号
  • 检查环绕
  • 检查正则表达式
  • 不要选中
    。匹配换行符
  • 全部替换
说明:

href="      : literally
(           : start group 1
  [^"]+     : 1 or more any character that is not a quote
)           : end group 1
给定示例的结果:

href="      : literally
(           : start group 1
  [^"]+     : 1 or more any character that is not a quote
)           : end group 1