Fix indexer class lookup by string when name has non-alphanumeric chars

This commit is contained in:
unknown
2015-07-19 11:37:08 -06:00
parent f045a1f350
commit c92caf18c5
4 changed files with 24 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Jackett.Utils
{
public static class StringUtil
{
public static string StripNonAlphaNumeric(string str)
{
Regex rgx = new Regex("[^a-zA-Z0-9 -]");
str = rgx.Replace(str, "");
return str;
}
}
}