toGlobRegex

fun String.toGlobRegex(ignoreCase: Boolean = false): Regex

Converts this string, interpreted as a glob pattern, to a regular expression.

Return

a Regex object that matches strings according to this glob pattern.

Author

OffRange

Parameters

ignoreCase

if true, the resulting regex will be case-insensitive. Default is false, as package names are typically case-sensitive.

Throws

if the glob pattern contains ** without a preceding dot.