I'm having files like given below I want to validate my file if first line is having "ZZ=" and third record is having only "XXX"
If this pattern doesnt match am rejecting file.
File example
ZZ=101
OO
XXX
111111111111
222222222222
00000000000
AAAAAAAAAAAA
valid file example
ZZ=101
OO
XXX
111111111111
222222222222
00000000000
AAAAAAAAAAAA
Not valid file
ZZ=101
OO
XSS (should be rejected except XXX)
111111111111
222222222222
00000000000
AAAAAAAAAAAA
Not valid file
HH=101 (should be rejected except ZZ=)
OO
XXX (should be rejected except XXX)
111111111111
222222222222
00000000000
AAAAAAAAAAAA
Is there any way I could use regex to match this pattern?
Any suggestions please..
Thanks !!