WardrikEvents.Pattern (wardrik_events v0.1.0-rc.1)

Copy Markdown

Matches log names against patterns. * matches any run of characters, and ? matches one.

WardrikEvents.Pattern.covers?("acme/*", "acme/triage")
#=> true

Summary

Functions

Returns true if pattern matches log.

Returns the part of pattern before its first wildcard.

Returns the org, the first segment of a pattern or log. Returns "*" if that segment has a wildcard.

Functions

covers?(pattern, log)

@spec covers?(String.t(), String.t()) :: boolean()

Returns true if pattern matches log.

literal(pattern)

@spec literal(String.t()) :: String.t()

Returns the part of pattern before its first wildcard.

org(pattern)

@spec org(String.t()) :: String.t()

Returns the org, the first segment of a pattern or log. Returns "*" if that segment has a wildcard.