Validate Captured text starts with (Except two values)

How to check if the Captured string starts with
E, F, H, I (Except I410 or I413), L, M, P, R, T, V

Logic 1 : If text starts with above letters then we need to assign value to the variable as YES

Logic 2 : If text starts with I410,I413 and other letters then we need to assign value to the variable as NO

Take Else if:
Input_Str.StartsWith(“E”)or Input_Str.StartsWith(“F”)…
Assign:Value=Yes
Else if:
Input_Str.StartsWith(“1410”)or Input_Str.StartsWith(“1413”)
Assign:Value=No
Else
Value=No

Hi @Sathish_Kumar_S ,
You can try
StartsWith (Text, Fragment)
eg: * StartsWith("Blueberry”, "blue"): True
then assign value
Regards,
LNV

grafik

Ensure the following:
RegexImport

Dynamize it with variables

Getting below error. Can you share the above regex command here?

Variable type is Regex and value is Regex.IsMatch(MaterialGroup.Replace(“I410”,^(I410I413)“,”—“),”[1]")


  1. EFHILMPRTV ↩︎

do not miss to quote the strings properly with double quotes

Thanks … now i am getting below error

dynamize it with variables

Hi @Sathish_Kumar_S

Use Else If acitivity and give below condition:

text.StartsWith("E") Or text.StartsWith("F") Or text.StartsWith("H") Or text.StartsWith("L") Or text.StartsWith("M") Or text.StartsWith("P") Or text.StartsWith("R") Or text.StartsWith("T") Or text.StartsWith("V")
Then
      result="YES"
ElseIf
 text.StartsWith("I410") Or text.StartsWith("I413")
Then
        result="NO"
Else
        result="NO"

Hope it helps!!

@Sathish_Kumar_S

You can try this as well

{"E","F", "H","I" , "L", "M", "P", "R", "T", "V"}.Any(function(x) str.StartsWith(x)) AndAlso Not {"I410","I430"}.Any(function(x) str.StartsWith(x))

Cheers