SubtitleEdit/libse/ReplaceExpression.cs
2019-01-19 14:40:37 +01:00

32 lines
1.0 KiB
C#

namespace Nikse.SubtitleEdit.Core
{
public class ReplaceExpression
{
public const int SearchNormal = 0;
public const int SearchRegEx = 1;
public const int SearchCaseSensitive = 2;
public const string SearchTypeNormal = "Normal";
public const string SearchTypeCaseSensitive = "CaseSensitive";
public const string SearchTypeRegularExpression = "RegularExpression";
public string FindWhat { get; set; }
public string ReplaceWith { get; set; }
public int SearchType { get; set; }
public ReplaceExpression(string findWhat, string replaceWith, string searchType)
{
FindWhat = findWhat;
ReplaceWith = replaceWith;
if (string.CompareOrdinal(searchType, SearchTypeRegularExpression) == 0)
{
SearchType = SearchRegEx;
}
else if (string.CompareOrdinal(searchType, SearchTypeCaseSensitive) == 0)
{
SearchType = SearchCaseSensitive;
}
}
}
}