i need to match "}\n}" (without quotes and newline as in real).
The regex to match "}\n}" is /}\n}/ (unless you're using m{}, in which case you need to write m{\}\n\}}). Since that's pretty obvious, I wonder if maybe you're having problems with some of your code? If that's the case, maybe you could show the code you're having problems with in the form of a Short, Self-Contained, Correct Example: a short, runnable piece of code that reproduces the issue, short sample input, the expected output for that input, and the output you're getting instead, including any error messages (code and input/output in <code> tags).