for Push.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user