此问题在此处已有答案:
Regex to match character if not between digits(2个答案)
7天前关闭。
假设我有一个文本如下
Lorem Ipsum-is simply dummy- text of the printing and -typesetting industry.
Lorem Ipsum - has been the industry's standard dummy text ever since the 1500s
a-z
如果-
字符不在两个字符([a-zA-Z])之间,我想删除它。因此,所需的输出为:
Lorem Ipsum-is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
a-z
如何编写正则表达式来匹配这种情况?
1条答案
按热度按时间fbcarpbf1#
删除前面不是
[a-zA-Z]
的内容以及后面不是[a-zA-Z]
的所有内容: