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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Disable regular expression in tFTPDelete

I have xml file names such as 1[.xml and CUP-[3000011769]-20180208142225.xml.

It is taking "[" bracket as regular expression. How to disable regular expression at FileMask.

 

0683p000009M6Zr.png

Labels (2)
1 Solution

Accepted Solutions
lennelei
Creator III
Creator III

You can use this in the filemask :

java.util.regex.Pattern.quote(((String)globalMap.get("tFileList_1_CURRENT_FILE")))

This command will escape characters from the Filename.

It produces an escaped RegEx so don't forget to tick the "Use Perl5 Regex Expressions as Filemask" checkbox

View solution in original post

6 Replies
lennelei
Creator III
Creator III

Hi,

 

you may uncheck the "Use Perl5 Regex Expressions as Filemask" and it will only take 2 wildcard characters: "*" for anything and "?" for a single character.

 

Regards

Anonymous
Not applicable
Author

Although i uncheck "Use Perl5 Regex Expressions as Filemask", it is not working. It catches bracket "[" as expression. I want to delete by current file name "((String)globalMap.get("tFileList_1_CURRENT_FILE"))".
lennelei
Creator III
Creator III

You're right, my bad. It seems that when unchecking, it uses this library to convert to Perl5 regex.

And according to the documentation, it support brackets notation from the Unix shell.

 

Unless you want to update the default component, I think you will have to work on the filename.

You might either escape only brackets (.replaceAll(...)), or you can use a more generic method such as Pattern.quote.

Anonymous
Not applicable
Author

Can you explain more on how to do it? Any way to disable regular expressions?

lennelei
Creator III
Creator III

You can use this in the filemask :

java.util.regex.Pattern.quote(((String)globalMap.get("tFileList_1_CURRENT_FILE")))

This command will escape characters from the Filename.

It produces an escaped RegEx so don't forget to tick the "Use Perl5 Regex Expressions as Filemask" checkbox

Anonymous
Not applicable
Author

The point of good I really favor in your blog. I am a freelance web developer NYC and i provide best web design services among other companies