I think it should be ``'/\bnamespace\s+([^;\{]+)(;|\{)/s'`` but this should be confirmed by some tests