MCPcopy Create free account
hub / github.com/kataras/iris / MatchString

Method MatchString

context/handler.go:84–94  ·  view source on GitHub ↗

MatchString reports whether "s" is literal of "literal" or it matches the regex expression at "regex".

(s string)

Source from the content-addressed store, hash-verified

82// MatchString reports whether "s" is literal of "literal"
83// or it matches the regex expression at "regex".
84func (expr *NameExpr) MatchString(s string) bool {
85 if expr.literal == s { // if matches as string, as it's.
86 return true
87 }
88
89 if expr.regex != nil {
90 return expr.regex.MatchString(s)
91 }
92
93 return false
94}
95
96// MatchFilename reports whether "filename" contains the "literal".
97func (expr *NameExpr) MatchFilename(filename string) bool {

Callers 11

matchAndReplaceMethod · 0.80
parseRedirectMatchLineFunction · 0.80
addr.goFile · 0.80
FileServerFunction · 0.80
cacheFilesFunction · 0.80
HandlerNameFunction · 0.80
IsMobileMethod · 0.80
IsScriptMethod · 0.80
SafeFilenameFunction · 0.80
hostAppFunction · 0.80
hostFilterFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected