如何检查一个通配符表达式(AKA glob)是否包含另一个通配符表达式?

问题描述 投票:0回答:0

我有两个通配符表达式g1和g2,我想知道g1是否包含g2。 例如:

g1 = "*.txt"
g2 = "hello*.txt

在这种情况下,g1 包含 g2。

algorithm pattern-matching wildcard glob string-comparison
© www.soinside.com 2019 - 2024. All rights reserved.