简体   繁体   English

在记事本中使用正则表达式查找特定字符串并使用特定掩码替换字符

[英]Regular expression to find specific string and replace characters using a certain mask in notepad++

Yet I am too weak in RegEx, so I need your help. 但是我在RegEx方面太虚弱,所以我需要您的帮助。 I've got for example: 我有例如:

" on 23%"

How can I use RegEx to get it converted into: 如何使用RegEx将其转换为:

" to 23%"

but to leave digits untouched? 但要保持数字不变? Note that "23" could be any 2 digits. 请注意,“ 23”可以是任何2位数字。

Use positive lookaround assertions like below. 使用正向环视断言,如下所示。

Find what: 找什么:

(?<= )on(?= \d+%)

Replace With: 用。。。来代替:

to

DEMO 演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM