Skip to content
⌘ NSIS Forum Archive

String Parsing

3 posts

torpark#

String Parsing

I have a registry string obtained from


ReadRegStr $R0 "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ProxyServer
The result is:

ftp=ftpserver:serverport;http=httpserver:serverport;socks=sockserver:serverport
I want to read between "http=" and the next ";" and parse the data inbetween. Some times there may be more or less fields like ftp or socks or gopher, etc. Sometimes the string may not have http in there at all. if "http=" is all that is there, there may not be a ";".

What is the best way of extracting httpserver and the corresponding serverport ? (it isn't actually "httpserver:serverport", obviously)

I am doing this to read the proxy configuration settings from a system.
bholliger#
Hi torpark!

Have a look at WordFind2X [1].

[1] http://nsis.sourceforge.net/Docs/AppendixE.html#E.3.4

Have fun!

Cheers

Bruno