Second commit
This commit is contained in:
commit
36840f3ad4
999 files changed
+61364
No files matched your search
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// This file is part of the Tremble package by Tiny Goose.
|
||||
// Copyright (c) 2024-2026 TinyGoose Ltd., All Rights Reserved.
|
||||
//
|
||||
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace TinyGoose.Tremble
|
||||
{
|
||||
public static class SimpleRegexUtil
|
||||
{
|
||||
public static Regex ToSimpleRegex(this string pattern)
|
||||
{
|
||||
// This is overly simplistic. But essentially, changes a pattern like
|
||||
// "my*thing" into a Regex like "^my.+thing$"
|
||||
return new($"^{pattern.Replace("*", ".+")}$");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user