GlobPattern

class GlobPattern(pattern: String, caseSensitive: Boolean = true)(source)

A pattern for matching file paths using glob syntax.

Supports standard glob pattern syntax:

    • matches any sequence of characters within a path segment

  • ** matches any sequence of characters across path segments

  • ? matches any single character

  • \[abc\] matches any character in the set

  • !abc matches any character not in the set

  • {a,b,c} matches any of the alternatives a, b, or c

Parameters

pattern

the glob pattern string

caseSensitive

whether the pattern matching should be case-sensitive (default: true)

Constructors

Link copied to clipboard
constructor(pattern: String, caseSensitive: Boolean = true)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun matches(path: String): Boolean

Tests if the given path matches this glob pattern.