寻找正则表达式以大写字母为基础拆分字符串

Dee*_*epa 4 c# regex

寻找关注sceaio的正则表达式解决方案:

我有字符串,我必须在大写的基础上拆分,但连续的大写部分不应该拆分.

例如:如果输入是

DisclosureOfComparativeInformation
Run Code Online (Sandbox Code Playgroud)

O/p应该是

Disclosure Of Comparative Information
Run Code Online (Sandbox Code Playgroud)

但连续的大写不应该分裂.

GAAP不应该导致G A A P.

如何找到特定的图案并插入空间?

感谢名单

ipr*_*101 8

试试 -

var subjectString = "DisclosureOfComparativeInformation";
var resultString = Regex.Replace(subjectString, "([a-z])([A-Z])", "$1 $2");
Run Code Online (Sandbox Code Playgroud)