Page 1 of 1

Regex Negation

Posted: Tue Nov 06, 2018 5:20 pm
by Support_Josh
Question:
Does GoAnywhere support regex negation? (The symbol ^ in a regex expression)

Answer:
Yes, GoAnywhere supports regex negation even when using monitors. This functionality can be handy when using a monitor since the monitor itself cannot be set to exclude a set of files, you can use a regex expression to select the files you don't want to include and then negate the expression.

Example:
I want to monitor a folder for all files existing that don't start with error*.*

File List:
test.txt
error.txt
error1.txt
error2.txt
goanywhere.log
catalina.out

Working Regex Expression:
^(?!error).*
NOTE: The above expression will select all entries that start with the word error and then return the opposite.

Output List:
test.txt
goanywhere.log
catalina.out