mhn
mhn

Reputation: 2750

Removing unwanted text from file - Regular expression

I have a file that contains data to be processed. The file has all lines starting with 3 alphabets in small case , followed by underscore , like below

xvz_abcd  some data something ....
xvz_abcd  some data something ....
xvz_abcd  some data something ....
xvz_abcd  some data something ....

However, there are few instances where the previous line has overflown into next line like

xvz_abcd  some data something ....
xvz_abcd  some data something ....
belong to previous line
xvz_abcd  some data something ....
xvz_abcd  some data something ....

Is there any Regular expression i can use to find and replace such instances? Had similar issue earlier where i had to isolate lines NOT starting with 5 numerals. Used

\n{(^~(:z^5).*$)}

can i tweak this for my current problem?

P.S: I am trying this on visual studio IDE

Upvotes: 0

Views: 56

Answers (1)

Rakesh KR
Rakesh KR

Reputation: 6527

Try [a-z]{3}_[a-z]{4} .* to match the desired line in the file.

Upvotes: 1

Related Questions