1
0
mirror of synced 2024-11-27 21:10:48 +01:00
TaikoSoundEditor/Extensions/StringExtensions.cs
NotImplementedLife 1ff7354141 first commit
2023-07-17 11:20:00 +03:00

25 lines
587 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace TaikoSoundEditor.Extensions
{
internal static class StringExtensions
{
public static Match Match(this string s, string regex, string options="")
{
var opts = RegexOptions.None;
if (options.Contains('i')) opts |= RegexOptions.IgnoreCase;
var r = new Regex(regex);
if (!r.IsMatch(s)) return null;
return r.Match(s);
}
}
}