以下の内容はhttps://baba-s.hatenablog.com/entry/2017/06/23/100000より取得しました。


【Unity】【NGUI】文字列にカラータグを含む場合 true を返す拡張メソッド

using System.Text.RegularExpressions;

public static class StringExt
{
    private static readonly Regex COLOR_TAG_PATTERN = 
        new Regex( @"(\[[0-9A-F]{6}\])", RegexOptions.IgnoreCase );
    
    public static bool ContainsColorTag( this string self )
    {
        return COLOR_TAG_PATTERN.IsMatch( self );
    }
}
var text = "[ffff00]ピカチュウ[-]";
Debug.Log( text.ContainsColorTag() );



以上の内容はhttps://baba-s.hatenablog.com/entry/2017/06/23/100000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14