continue
}
- if isEmail(candidatePath) || isDate(candidatePath) || isVersion(candidatePath) || isGitRange(candidatePath) || isGitInstruction(candidatePath) || startsWithInvalidString(candidatePath) || endsWithInvalidString(candidatePath) || containsInvalidString(candidatePath) || len(candidatePath) <= 2 || isSpace(candidatePath) {
+ if isIp(candidatePath) || isEmail(candidatePath) || isDate(candidatePath) || isVersion(candidatePath) || isGitRange(candidatePath) || isGitInstruction(candidatePath) || startsWithInvalidString(candidatePath) || endsWithInvalidString(candidatePath) || containsInvalidString(candidatePath) || len(candidatePath) <= 2 || isSpace(candidatePath) {
continue
}
if isGitPath(candidatePath) {
t.Errorf("Matches sentence", output)
}
+ output = GetAllMatches("0.0.0.0:3000", "")
+ if len(output) != 0 {
+ t.Errorf("Match ipadress", output)
+ }
+
output = GetAllMatches("'/usr/bin", "")
if output[0] != "/usr/bin" {
t.Errorf("Doesn't match statement correctly", output)
return string(temp[1])
}
+func isIp(input string) bool {
+ r := regexp.MustCompile("^[0-9]{1,3}\\.[0-9x]{1,3}\\.[0-9x]{1,3}\\.[0-9x]{1,3}$")
+ return r.Match([]byte(input))
+}
+
func isVersion(input string) bool {
r := regexp.MustCompile("^v?[0-9x]{1,3}\\.[0-9x]{1,3}(\\.[0-9x]{1,3})?$")
return r.Match([]byte(input))