а почему для третьей строки 42 - в результате один раз?
[vba]Код
Function f$(s$)
Set r = CreateObject("vbscript.regexp")
r.Pattern = "\((\d+)\)": r.Global = True
Set m = r.Execute(s)
For Each e In m: f = f & ";" & e.submatches(0): Next
f = Mid(f, 2)
End Function
[/vba]
для уникальных
[vba]Код
Function g$(s$)
Set r = CreateObject("vbscript.regexp")
Set d = CreateObject("scripting.dictionary")
r.Pattern = "\((\d+)\)": r.Global = True
Set m = r.Execute(s)
For Each e In m: d(e.submatches(0)) = 0&: Next
g = Join(d.keys, ";")
End Function
[/vba]