cc: Make whitespace-only a valid input for ransomware target directory paths

This commit is contained in:
Shreya 2021-07-02 16:09:40 +05:30
parent 1768c0cdf6
commit 54072b6632
1 changed files with 4 additions and 4 deletions

View File

@ -1,10 +1,10 @@
const ipRegex = '((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' const ipRegex = '((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'
const cidrNotationRegex = '([0-9]|1[0-9]|2[0-9]|3[0-2])' const cidrNotationRegex = '([0-9]|1[0-9]|2[0-9]|3[0-2])'
const hostnameRegex = '^([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*.?)*([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*)$' const hostnameRegex = '^([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*.?)*([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*)$'
// path starts with `/` OR `$` // path is empty, or starts with `/` OR `$`
const linuxDirRegex = '^/|^\\$' const linuxDirRegex = '(^\\s*$)|^/|^\\$'
// path starts like `C:\` OR `C:/` OR `$` OR `%abc%` // path is empty, or starts like `C:\` OR `C:/` OR `$` OR `%abc%`
const windowsDirRegex = '^([A-Za-z]:(\\\\|\\/))|^\\$|^(%\\w*\\d*\\s*%)' const windowsDirRegex = '(^\\s*$)|^([A-Za-z]:(\\\\|\\/))|^\\$|^(%\\w*\\d*\\s*%)'
export const IP_RANGE = 'ip-range'; export const IP_RANGE = 'ip-range';