Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

match whole file context using regex at once

Hi 
I have one regex that matches whole file content pattern. Its a text file.
How can I achieve this in talend.
I was trying like this 
tfileinputraw ----->tjavarow
String regex  = "(\\AX.*(?:\\r?\\n.*)*\\r?\\nZ.*(?:\\r?\\nX.*(?:\\r?\\n.*)*\\r?\\nZ.*)*\\z)";
context.regex = input_row.content.toString();
if (context.regex.matches(regex))
{
   System.out.println("valid");
}
else
{
  System.out.println("not valid");
}   
So its not working as expected. Any suggestions ?
Labels (3)
1 Reply
vapukov
Master II
Master II

construction as is - work ( I use little more simple tFileInputFullRow -> tJavaFlex)
You must go from simple to complex, step-by-step
for example - change regex to simple (sample data - my own of course):

1709213380
valid
17153033806052016ABCD05082016YXA
not valid


So, the question - what You expect from Your regex pattern? dose it work on any regex tester? for example -  https://regex101.com