用空格正则表达式替换新行

时间:2014-05-05 00:33:30

标签: regex eclipse

您好我想加入下一段的第一行。所以基本上从1中删除\ n并将其与第二段连接。

1. 
This is the second line: 
A) xyz89797 
B) xyz89797 

2. 
This is the another line: 
A) xyz89797 
B) xyz89797 

我想将上段作为

1. This is the second line: 
A) xyz89797 
B) xyz89797 

2. This is the another line: 
A) xyz89797 
B) xyz89797 

在eclipse中替换我使用[0-9] \。这是匹配十进制uptill。但是不能得到新的\ n \ r \ n我应该用它替换它?

1 个答案:

答案 0 :(得分:1)

查找

(\d+)\.\n

替换:

$1.

我使用了字符类\d,并允许使用+多个数字。

$1是第一个捕获组(括号内的所有内容)。

相关问题