using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Text.RegularExpressions;
public InputField SearchInputField; var isMatchSuccess = Regex.IsMatch(TKDeviceGroupManegerRef.SearchDeviceStringList[i],SearchInputField.text); if (isMatchSuccess) { Debug.LogError("匹配~"+ SearchInputField.text); } 例: string str1 = "刘备关羽张飞孙权何问起"; string strInput = "关羽"; if (Regex.IsMatch(source, strInput )) { Debug.LogError("匹配~"+ strInput );//包括模糊搜索匹配