且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

注册表项为";或/或";,但不是";既不是";也不是";

更新时间:2022-06-09 08:27:45

您可以按如下方式使用If-Then-Else

(_)?R(?(1)_?|_)

Demo

这使您可以只写入R一次。

明细:

(_)?        # An optional capturing group that matches an underscore character.
R           # Matches 'R' literally (replace it with your pattern).
(?          # If...
    (1)     # ..the first capturing group is found,...
    _?      # ..then match zero or one underscore characters (optional).
|           # Else (otherwise)...
    _       # Match exactly one underscore character (required).
)           # End If.

在记事本++中工作: