How can I parse a string and extract the text from in between a bracket syntax ( like <ID>12321</ID> I am working with the following string format:
<ID>298343</ID><TITLE>This is free text-that may contain / any character . . . <TITLE><ID>192723</ID><TITLE>Loreum Ipsum<TITLE><ID>298343</ID><TITLE>Thanks for help<TITLE><ID>192723</ID><TITLE>Strings are hard<TITLE>
Ideally, I'd like to read all of the digits as text into an array of strings. There may be up to a hundred ID values in these stings.
Yes, I am starting with XML. I am working with a format that gives me that markup:
[xml]$XMLResponse = $webclient.DownloadString("http://url.com/file.xml")
Write-Output $XMLResponse."string".ChildNodes
The output is:
Name : #text
LocalName : #text
NodeType : Text
ParentNode : string
Value : <ID>298343</ID><TITLE>This is free text-that may contain / any character . . . <TITLE><ID>192723</ID><TITLE>Loreum Ipsum<TITLE><ID>298343</ID><TITLE>Thanks for help<TITLE><ID>192723</ID><TITLE>Strings are hard<TITLE>
InnerText : <ID>298343</ID><TITLE>This is free text-that may contain / any character . . . <TITLE><ID>192723</ID><TITLE>Loreum Ipsum<TITLE><ID>298343</ID><TITLE>Thanks for help<TITLE><ID>192723</ID><TITLE>Strings are hard<TITLE>
Data : <ID>298343</ID><TITLE>This is free text-that may contain / any character . . . <TITLE><ID>192723</ID><TITLE>Loreum Ipsum<TITLE><ID>298343</ID><TITLE>Thanks for help<TITLE><ID>192723</ID><TITLE>Strings are hard<TITLE>
Length : 2464
PreviousSibling :
NextSibling :
ChildNodes : {}
Attributes :
OwnerDocument : #document
FirstChild :
LastChild :
HasChildNodes : False
NamespaceURI :
Prefix :
IsReadOnly : False
OuterXml : <ID>298343</ID><TITLE>This is free text-that may contain / any character . . . <TITLE><ID>192723</ID><TITLE>Loreum Ipsum<TITLE><ID>298343</ID><TITLE>Thanks for help<TITLE><ID>192723</ID><TITLE>Strings are hard<TITLE>
InnerXml :
SchemaInfo : System.Xml.Schema.XmlSchemaInfo
BaseURI :