glob_matching

package
v0.0.0-...-86b9fec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2022 License: MIT Imports: 0 Imported by: 0

README

Glob Matching

In most modern-day computers, glob patterns are used to refer to multiple file names on the computer's system at once.

Glob patterns typically take advantage of the following two special characters:

    1. Wildcards, represented by the * symbol, which match any number of characters, including zero characters.
    1. Question marks, represented by the ? symbol, which match any single character (exactly one). For example, the glob pattern "*.js" matches any file name ending in the JavaScript .js extension.

Write a function that takes in a file name and a pattern (both strings) and returns whether that file name matches the pattern.

Sample Input

fileName = "abcdefg"
pattern = "a*e?g"

Sample Output

true

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobMatching

func GlobMatching(fileName, pattern string) bool

GlobMatching O(n * m) time | O(n * m) space - where n is the length of the fileName and m is the length of the pattern.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL