Regex: reduce allocation slightly, add tests, code cleanup, add parser comments (#30632)
* RegexParser & optionsstack ref
* Add test coverage for Group.Synchronized
* Adjust options mode test case
* Add inline comment '#' test branch
* Add comments
* Replace manual ToLower calls by Span.ToLower
* Make applicable fields readonly in parser
* Change to Assert to reduce an if check in one branch
* Code formatting
* Avoid string allocation when IgnoreCase set
Prefix patterns which are passed to RegexBoyerMoore are already
lowercased by the parser. Remove the redundant ToLower() call and assert
the patterns lowercase state
* Add surrogate pair positive & negative tests
* Add test cases for rtl anchor
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>