回复 8# yuanyannian
以下只是想当然,没做测试:
62~66行(未作容错处理,如果匹配不上,可能报下标越界): | LG = Split(ProssLocales(s), ",") | | s = ReplaceStr(s, "\[LG_INSTALL_(" & LG(0) & "|" & LG(1) & ")]", "[DefaultInstall]")COPY |
函数部分: | Function ProssLocales(ByVal s) | | strKey = "Locales" | | pattern1 = "^ *\[" & strKey & "] *$" | | pattern2 = "^ *" & sLoca & " *=([^,]*,){2}([^,]*,[^,]*),.*$" | | Set re = New RegExp | | re.Pattern = pattern1 & "[\s\S]*?" & pattern2 | | re.IgnoreCase = true | | re.MultiLine = true | | For Each m in re.Execute(s) | | ProssLocales = m.SubMatches(1) | | Next | | End FunctionCOPY |
|