12 lines
308 B
Go
12 lines
308 B
Go
package parsers
|
|
|
|
import "regexp"
|
|
|
|
type LanguageParserFunc func(str string) []string
|
|
|
|
var SquareBracketsLanguageParserRegex = regexp.MustCompile(`\[.+?\]`)
|
|
|
|
func SquareBracketsLanguageParser(str string) []string {
|
|
return TrimPrefixSuffix(SquareBracketsLanguageParserRegex.FindAllString(str, -1), "[", "]")
|
|
}
|