Hello Team,
I need to find if value1 Y OR N date is present in mainframe screen. Here value 1 has some value , after few spaces Y or N will be there then after few spaces date will be there.
Please help me with regex or how we can achieve this.
Thank you
I have taken the sample data like below if value1 as some value after that Y OR N After spaces date so this will matches the exactly one for your scenario
Hi Praveen , value1 is the string that I will pass in regex also the date. Also there are 11 spaces before Y/N and 3 spaces after Y/N. Shall it be like :
System.Text.RegularExpressions.Regex.IsMatch(input,“+str_value1+\s{0,}[YN]\s{0,}+str_Date”)
I am sorry I am newbie in regex.
I have mainframe screen scraped in string having multiple rows with records like
X1 Y 11/12/2023 CC1 DD EE
X2 N 11/12/2023 CC2 DD EE
X3 Y 02/12/2023 CC3 DD EE
X4 N 02/12/2023 CC4 DD EE
X5 Y 11/12/2023 CC5 DD EE
So this i have in string variable mainframescreen now .
variable value1 = X1
variable value2 = 11/12/2023
Now i want to check whether this mainframescreen string has value like :
value1 Y value2
here u can see there is space between value1 and Y . also there is space between Y and value2.
Please share the regex to match.
for example your variable having the value 1 = X1,X2…SO on etc
and str_date = 11/12/2023 …so on , so it will match for your pattern like Y OR N
You can try this regex expression it will work for you and it will match the spaces between there are 11 spaces before Y/N and 3 spaces after Y/N. it will match