mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-24 04:02:36 +01:00
32 lines
1.0 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|