Home  >  Article  >  Development Tools  >  How to write regular expressions in notepad

How to write regular expressions in notepad

藏色散人
藏色散人forward
2021-12-02 15:13:344512browse

下面由notepad教程栏目给大家介绍notepad如何写正则表达式,希望对需要的朋友有所帮助!

问题描述:

这个正则表达式用notepad++怎么写?

原文本:

<City Name="北京" Code="1" />

我想改成这样:

<a>北京</a>

在notepad++里面这样写的:

查找目标

替换为1

问题:

上面的正则表达式匹配不到,要怎样写才可以?

解决办法:

<a>$1</a>

匹配没问题,替换内容有问题

How to write regular expressions in notepad

注:

如果提示cant find text "",因为xml文件格式,后面加个?就可以匹配了。

The above is the detailed content of How to write regular expressions in notepad. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete