So I'm having the following issue with regular expressions:
What I am trying to achieve: Get the last element of the namespace, in this case "BAZ"
To do so I am using the regular expression below:
preg_match("/[^\\]*$/", 'Foo\Bar\Baz', $output);
For some reason I get this error:
preg_match(): Compilation failed: missing terminating ] for character class at offset 6