如何仅替换找到的文本的一部分? [英] How to replace only part of found text?

查看:56
本文介绍了如何仅替换找到的文本的一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件,其中包含一些逗号分隔的名称和一些逗号分隔的帐号.
名称将始终类似于 Dow, John 和诸如 012394,19862 之类的数字.

I have a file with a some comma separated names and some comma separated account numbers.
Names will always be something like Dow, John and numbers like 012394,19862.

使用Notepad++ 的Regex Find"功能,我想用管道| 替换数字之间的逗号.

Using Notepad++'s "Regex Find" feature, I'd like to replace commas between numbers with pipes |.

基本上:

turn:  Dow,John      into:  Dow,John
       12345,09876          12345|09876
       13568,08642          13568|08642

我一直在使用 [0-9],找到逗号,但我无法让它正确地保留数字的最后一位数字并替换 只是逗号.

I've been using [0-9], to find the commas, but I can't get it to properly leave the number's last digit and replace just the comma.

有什么想法吗?

推荐答案

搜索 ([0-9]), 并将其替换为 \1|.这行得通吗?

Search for ([0-9]), and replace it with \1|. Does that work?

这篇关于如何仅替换找到的文本的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆