开发者

Replacing text with Regex

开发者 https://www.devze.com 2023-04-01 18:39 出处:网络
I have a text file that contains a data dump from a database. This开发者_运维技巧 is space delimited and as stupid as this sounds, this is what I have to work with.

I have a text file that contains a data dump from a database. This开发者_运维技巧 is space delimited and as stupid as this sounds, this is what I have to work with. The problem that I have is that there's a free textfield that includes newlines.

So what I would try to do is replace every \r that is not followed by an id that matches the following pattern [0-9]{6}


If the tool you are working with support regular expression with look-around assertions, you could use

\r(?!\d{6})
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号