Hi,
I have my preferences file laid out like this (example):
----
<Option1>thedatagoeshere</Option1>
<Option2>mydata</Option2>
<Option3>
datarow1
datarow2
datarow3
datarow4
<Option3>
----
Now I have this code to retrieve the data inside of the <bla> </bla> tags
(for both). This is a method I have made, before this method is executed, I
have retrieved the data from the file. The option string is the tag string I
want to search for and the data is the files complete data.
----
Function Retrieve(option as string, data as string)
dim rg as RegEx
dim myMatch as RegExMatch
dim tempdata as string
rg = new RegEx
rg.SearchPattern = "<" + Option + ">.*</" + Option + ">"
myMatch = rg.search(data)
If myMatch <> nil then
tempdata = myMatch.SubExpressionString(0)
else
msgbox "Sorry, but the selected preference option could not be found!"
end if
return tempdata
exception err as RegExException
MsgBox err.message
End Function
----
For some reason I can't get it to work. I'm thinking that the search string
is wrong and it's probably the most likely explanation. Can anybody help me
here?
Regards.
--------
Chris Willis