see notes below. It looks like these sreg variables are never used.
Maybe I am missing something but I am not seeing this function being called anywhere?
Maybe I am missing something, but it looks like the only place this is called from is StaticStripRtfCommands - which is never called --- so this code will never be called / executed?
A new class like this or extending an existing class should be in it's own cs file so it can be found easily. --- also, otherwise it may be difficult to tell when it will work or not.
Can simplify this to have less executions / possibly use LINQ. See recommendations that SonrLint Visual Studio Ext will give.
Not critical -- but just a side suggestion to make things easier for future possible changes ---- I would suggest reviewing this file and try to fix some of the spacing issues --- there are a lot of items showing as changes that are not actual changes (i.e. removed blank lines or added / removed spaces) -- this makes it difficult to tell what was / wasn't changed and more likely to miss something / make a mistake. It also means that all these items will show up in history as being changed by this project. This could make diagnosing future issues more difficult (i.e. something that may have always been a certain way may appear it was changed with this project.)
There are all these: galleryContainerSymbolsCM, CM3, galleryContainerSymbolsGrid, etc...