Rob Hufschmitt
Rob Hufschmitt

Reputation: 409

Replacing text with Regex

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}

Upvotes: 1

Views: 71

Answers (1)

Jens
Jens

Reputation: 25563

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

\r(?!\d{6})

Upvotes: 1

Related Questions