Fix regex pattern

Fix regex pattern to match following patterns.
```
    namespace
    { // new line + some spaces
```
```
namespace{ // no new line nor space
````