Class EditActionSearchReplace
An edit action to run a search/replace operation. Note that the search pattern will generally not be found if the text is interrupted by tags.
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemory.EditScripts
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
public class EditActionSearchReplace : EditAction
Constructors
EditActionSearchReplace()
Declaration
public EditActionSearchReplace()
Properties
ApplyToTarget
If true, the S/R will be applied to the target segment. If false (default), it will be applied to the source segment.
Declaration
public bool ApplyToTarget { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IgnoreCase
Gets or sets a flag whether or not to apply the pattern matching in a case-insensitive manner. For literal searches, some "intelligent" casing will be applied to the replacement. For regular expression searches, see System.Text.RegularExpressions.Regex how case-insensitive S/R is handled.
Declaration
public bool IgnoreCase { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
PatternType
Gets or sets the type of the pattern. When searching literal patterns, the replacement must also be a literal pattern. When searching regular expression patterns, the replacement will also be interpreted as a regular expression replacement pattern.
Declaration
public PatternType PatternType { get; set; }
Property Value
Type | Description |
---|---|
PatternType |
ReplacementPattern
Gets or sets the replacement for the search pattern, if found.
Declaration
public string ReplacementPattern { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SearchPattern
Gets or sets the pattern to search. If this is a regular expression, it will later be compiled with the System.Text.RegularExpressions.RegexOptions.CultureInvariant and the System.Text.RegularExpressions.RegexOptions.IgnoreCase options (if the IgnoreCase flag is set. No other regular expression flags will be applied.
Declaration
public string SearchPattern { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Apply(TranslationUnit)
Declaration
public override bool Apply(TranslationUnit tu)
Parameters
Type | Name | Description |
---|---|---|
TranslationUnit | tu | The TU to apply the edit action to |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Validate(IFieldDefinitions, Boolean)
See Validate(IFieldDefinitions, Boolean). Always returns true
for instances of this class.
Declaration
public override bool Validate(IFieldDefinitions fields, bool throwIfInvalid)
Parameters
Type | Name | Description |
---|---|---|
IFieldDefinitions | fields | The field definitions to validate against. |
System.Boolean | throwIfInvalid | If true, an exception will be thrown if invalid field names or other issues are encountered. If false, the return value will be set to false without an exception being thrown. |
Returns
Type | Description |
---|---|
System.Boolean |
|