34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace KssSmaPlaLib.AutoTest.Script.Parse.Function
|
|
{
|
|
public class FunctionTryUxer
|
|
{
|
|
public static bool TryFunction(string input, out string functionName, out List<string> funcArgList,out string resultMessage)
|
|
{
|
|
functionName = "";
|
|
funcArgList = new List<string>();
|
|
resultMessage = string.Empty;
|
|
|
|
var match = Regex.Match(input, @"^(\w+)\((.*?)\)$");
|
|
if (match.Success)
|
|
{
|
|
functionName = match.Groups[1].Value;
|
|
var args = match.Groups[2].Value;
|
|
if (!string.IsNullOrWhiteSpace(args))
|
|
{
|
|
funcArgList.AddRange(args.Split(','));
|
|
}
|
|
return true;
|
|
}
|
|
resultMessage = $"シグネチャ形式が不正です。[シグネチャ:{input}]";
|
|
return false;
|
|
}
|
|
}
|
|
}
|