Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function ParseJSON(strTxt)
  2.  
  3. Set objFSO = CreateObject("Scripting.FileSystemObject")
  4. Set objFile = objFSO.OpenTextFile( AppData & ".technic\installedPacks", 1)
  5. installedPacks = objFile.ReadAll
  6.  
  7.     Dim oRE
  8.     Dim colMatches
  9.     Dim oMatch, I
  10.     Set oRE = New Regexp
  11.     oRE.Global = True
  12.     oRE.Pattern = """build"":\s""(.+?)"""
  13.     oRE.IgnoreCase = False
  14.     Set colMatches = oRE.Execute(strTxt)
  15.     For Each oMatch In colMatches
  16.        
  17.         If oMatch.SubMatches(0) = "recommended" Then
  18.         Else
  19.             strNextmap = oMatch.SubMatches(0)
  20.         End If
  21.    
  22.     Next
  23.    
  24. If strNextmap = "" Or IsNull (strNextmap) Then
  25.     ParseJSON = "No Match Found"
  26. Else
  27.     ParseJSON = strNextmap
  28. End If
  29. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement