TwistAndShutter
TwistAndShutter

Reputation: 239

Visual Studio: replacing { and new line

I found out that I can write in the "find and replace box" regular expression in order to find new line inside the code of Visual Studio, but what I want to do is "for every '{' followed by a new line, replace it with the next syntax symbol". In other words:

class Parser5 : Parser
{
    public Parser5(Scanner scanner) : base(scanner)
    { }
    public override Loop ParseLoop()
    {
        if(//some stuff)
        {
               return this.ParseNestedLoop();
        }
    }
}

With:

class Parser5 : Parser
{   public Parser5(Scanner scanner) : base(scanner)
    { }
    public override Loop ParseLoop()
    {   if(//some stuff)
        {return this.ParseNestedLoop();
        }
    }
}

Upvotes: 1

Views: 1839

Answers (1)

vks
vks

Reputation: 67968

 \{\n(?<=\{\n)(.*$)

You can use this.

See demo.

http://regex101.com/r/sA7pZ0/31

Upvotes: 1

Related Questions