Alexander
Alexander

Reputation: 20234

Remove a newline and tabs

We want to change all occurrences of

},
{

to

},{

no matter how far they are indented (using tabs).

Notepad++ won't recognize my regexps },(\t*)\n{ and },(\t)*\n{, and I don't know why.

Which is the correct regexp?

Upvotes: 0

Views: 56

Answers (3)

Avinash Raj
Avinash Raj

Reputation: 174806

You don't need to capture anything..

REgex:

},\s+{

Replacement string:

},{

\s matches any white space character [\r\n\t\f ]

DEMO

Upvotes: 0

revo
revo

Reputation: 48751

I don't know why but you should escape { & } in Notepad++

\},\s*\{

Then replace it with },{

\s means any white space character [\r\n\t\f ]

Upvotes: 0

vks
vks

Reputation: 67988

  \s*(\}\,)[\n\s]*(\{)

This should do it.

See demo.

http://regex101.com/r/rI6jZ0/1

Upvotes: 1

Related Questions