docs.unity3d.com
    目次を表示する/隠す

    Is Match フォーマッター

    Is Match Formatter (Is Match フォーマッター) を使用して、出力を制御するために 正規表現 を評価できます。 Is Match フォーマッターはデフォルトでは含まれていません。Smart Format の設定 内で Formatters に追加することができます。

    ノート: このフォーマッターのオプション部分では、全ての RegEx 文字が有効なわけではなく、例えば波括弧や丸括弧はサポートされていません。これは、他の全ての拡張機能と同じパーサーが使用されているためです。

    Smart String の構造と、IsMatch を使用した場合に各部がどのように評価されるかを示す図

    Smart String の例 引数 結果
    {theKey:ismatch(^.+123.+$):Okay - {}|No match content}
    new Dictionary<string, object>() { {"theKey", "Some123Content"}}
    
    Okay - Some123Content
    {theKey:ismatch(^.+123.+$):Fixed content if match|No match content}
    new Dictionary<string, object>() { {"theKey", "Some123Content"}}
    
    Fixed content if match
    {0:list:{:ismatch(^100|200|999$):{:0.00}|'no match'}|, | and }
    new List<int> {100, 200, 300}
    
    100.00, 200.00 and 'no match'
    {0:list:{:ismatch(^100|200|999$):'match'|'no match'}|, | and }
    new List<int> {100, 200, 300}
    
    'match', 'match' and 'no match'
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)