I'm trying to write some regex in order to force a new line after function opening bracket.Currenly my regex is \{[^\n\{\}]*\n\n
but it returns the opposite thing and ideas?
Asked
Active
Viewed 278 times
0

sger
- 719
- 2
- 12
- 26
-
The pattern matches 2 newlines. https://regex101.com/r/zb1fdn/1 Can you add an example? What do you mean with `"the opposite"? – The fourth bird Nov 30 '19 at 09:42
-
I want to detect if the user hasn't entered a new line after opening bracket of the function – sger Nov 30 '19 at 09:54
-
Do you mean using a lookahead instead? `\{[^\n{}]*(?=\r?\n)` https://regex101.com/r/KiN7Jt/1 – The fourth bird Nov 30 '19 at 10:08