I need to split T-SQL script files along the batch delimiter boundary and execute each segment separately.
Splitting is easy.
GO statements need to be alone on a line and can only be preceded and followed by white space.
(Exception: GO can also be followed by a number but not a variable. I am ignoring this case for now. I am also ignoring for now the case of an inline comment after GO)

However, GO statements can be found inside block comments (where they are obviously ignored). Splitting along that boundary will result in broken code.
I want to check and reject the script file if it contains a GO statement inside a block comment.

So far I have built this regex:

```
(\/\*)(.?([^\*][^\/])*?)(^(\s*?)go(\s*?)$)(.?([^\/][^\*])*?)(?=(\*\/))

```

It almost works, but it still has issues.

Splitting and identifying non compliant files will be done in PowerShell. 

Note: At this stage it has been established we will not YET pursue using a parser. Possible parser options are still being investigated

I tested in regex101.com using this by adding and removing letters:

```none
/*
llaa

GO

*/

GO

/*
a
*/

GO
a
/*

GOaaa

*/
a
GO

/*

a

*/

```