<commit_before>﻿## func Match(pattern, name string) (matched bool, err error)

参数列表

- pattern 匹配的模式
- name 原始字符串

返回值：

- 返回bool error

功能说明：

这个函数主要是文件名匹配，只有完全匹配则返回true，nil
- pattern 规则如下:
~~~
pattern:
	{ term }
term:
	'*'         matches any sequence of non-/ characters
	'?'         matches any single non-/ character
	'[' [ '^' ] { character-range } ']'
	            character class (must be non-empty)
	c           matches character c (c != '*', '?', '\\', '[')
	'\\' c      matches character c

character-range:
	c           matches character c (c != '\\', '-', ']')
	'\\' c      matches character c
	lo '-' hi   matches character c for lo <= c <= hi
~~~


代码实例：
~~~
package main

import (
	"fmt"
	"path"
)

func main() {
	fmt.Println(path.Match("*","alll")) //true nil
	fmt.Println(path.Match("*","a/lll")) //false nil
	fmt.Println(path.Match("?","alll")) //false nil
	fmt.Println(path.Match("?","a")) //true nil
	fmt.Println(path.Match("a","a")) //true nil
	fmt.Println(path.Match("\\a","a")) //true nil
}
~~~<commit_msg>edit match.md<commit_after>﻿## func Match(pattern, name string) (matched bool, err error)

参数列表

- pattern 匹配的模式
- name 原始字符串

返回值：

- 返回bool error

功能说明：

这个函数主要是文件名匹配，只有完全匹配则返回true，nil
- pattern 规则如下:
~~~
pattern:
	{ term }
term:
	'*'         matches any sequence of non-/ characters
	'?'         matches any single non-/ character
	'[' [ '^' ] { character-range } ']'
	            character class (must be non-empty)
	c           matches character c (c != '*', '?', '\\', '[')
	'\\' c      matches character c

character-range:
	c           matches character c (c != '\\', '-', ']')
	'\\' c      matches character c
	lo '-' hi   matches character c for lo <= c <= hi

package main

import (
	"fmt"
	"path"
)

func main() {
	fmt.Println(path.Match("*","alll")) //true nil
	fmt.Println(path.Match("*","a/lll")) //false nil
	fmt.Println(path.Match("?","alll")) //false nil
	fmt.Println(path.Match("?","a")) //true nil
	fmt.Println(path.Match("a","a")) //true nil
	fmt.Println(path.Match("\\a","a")) //true nil
}
~~~
{'fraction_non_alphanumeric': 0.20537897310513448, 'fraction_numerical': 0.0, 'mean_word_length': 2.824299065420561, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4573881', 'n_tokens_mistral': 821, 'n_tokens_neox': 825, 'n_words': 190}