Sublime Forum

How can i ADD a new line after a certain pattern being found by regular expression?

#1

hi everyone, i’m just wondering how can i add a new line after certain pattern being found by regular expression? cause i’ve got so many macro programs with different names in SAS environment. I need clean them up. Thanks for help.
here is what i’ve got
eg.
%MACRO A

%MEND A;
%A
%MACRO B

%MEND B;
%B

here is what i want;

%MACRO A

%MEND A;

%A
%MACRO B

%MEND B;

%B

0 Likes

#2

Surround your regex by parenthesis and do a replace by \1\n

1 Like

#3

it works, thank you so much! ^_______________^

0 Likes