Forum Discussion
_anomDiebolt_
10 years agoQrew Elite
That code would fail if attempting to parse the MEMO data which has spaces in its value. The statement I used is simple
doc.match(/<TRNTYPE>(.*?)</)[1].trim();
Match and capture all text after "<TRNTYPE>" up to the next "<" delimiter (ie non-greedy match)- trim the result of extra whitespace.
doc.match(/<TRNTYPE>(.*?)</)[1].trim();
Match and capture all text after "<TRNTYPE>" up to the next "<" delimiter (ie non-greedy match)- trim the result of extra whitespace.