小编pri*_*nka的帖子

Java正则表达式用两个空格替换单个字母和空格

任何人都可以帮助我使用正则表达式替换所有单个字母与空格.例:

 input: "this is a t f with u f array"
output: "this is       with     array".
Run Code Online (Sandbox Code Playgroud)

我的正则表达式是replaceAll("(\\s+[a-z]\\s+)"," "); 但它的工作原理如下:

  input: "this is a t f with u f array"
 output: "this is   t f with   f array".
Run Code Online (Sandbox Code Playgroud)

java regex

2
推荐指数
1
解决办法
2000
查看次数

标签 统计

java ×1

regex ×1