Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 在正则表达式中添加新行_Regex - Fatal编程技术网

Regex 在正则表达式中添加新行

Regex 在正则表达式中添加新行,regex,Regex,我需要在正则表达式的开头添加新行,但我不知道怎么做。这是我的正则表达式 使用以下正则表达式 s/(\d{5})/\r\n\1/gs 或 s/(?我想使用我的正则表达式,在正则表达式的开头,我想添加新行空间,您使用的是哪种语言?您能发布您的代码吗?也许这就是您想要的……我需要它来过滤json数据 s/(?<=\D)(\d{5})(?=\D|$)/\n\1/g

我需要在正则表达式的开头添加新行,但我不知道怎么做。这是我的正则表达式


使用以下正则表达式

s/(\d{5})/\r\n\1/gs


s/(?我想使用我的正则表达式,在正则表达式的开头,我想添加新行空间,您使用的是哪种语言?您能发布您的代码吗?也许这就是您想要的……我需要它来过滤json数据
s/(?<=\D)(\d{5})(?=\D|$)/\n\1/g