Forum Discussion
pricedgp
12 years agoContributor
I was trying to simplify my example, but maybe therein lies the issue. Here's a typical block of text -- all of which is within a single element:
<COREEnvelopeRealTimeResponse>ISA*00* *00* *ZZ*RECEIVERS.ID...*ZZ*SUBMITTERS.ID..*140902*1530*^*00501*493605191*0*P*\~
GS*HN*RECEIVER CODE*SENDER CODE*20140902*153037*1*X*005010X212~
ST*277*0001*005010X212~
BHT*0010*08*1*20140902*153037*DG~
HL*1**20*1~
NM1*PR*2*PHIC*****PI*52-8070835~
PER*IC*John Doe*TE*7812851300~
I'm trying to assert the existence of (in this example), "PI*52-0870835", which as a property expansion, would be "PI*${hcc_id}". I figured I'd have better luck using regex than using a simple match.
XPath match doesn't seem to work here -- probably due to the asterisks in the content. It will only work for something at the very beginning of the element, but once there's an asterisk in the text, it won't match. For example, I can match ISA if I turn on the wildcards option (by matching on "ISA*"), but I can't match on, say, ISA*00.
Thanks.
<COREEnvelopeRealTimeResponse>ISA*00* *00* *ZZ*RECEIVERS.ID...*ZZ*SUBMITTERS.ID..*140902*1530*^*00501*493605191*0*P*\~
GS*HN*RECEIVER CODE*SENDER CODE*20140902*153037*1*X*005010X212~
ST*277*0001*005010X212~
BHT*0010*08*1*20140902*153037*DG~
HL*1**20*1~
NM1*PR*2*PHIC*****PI*52-8070835~
PER*IC*John Doe*TE*7812851300~
I'm trying to assert the existence of (in this example), "PI*52-0870835", which as a property expansion, would be "PI*${hcc_id}". I figured I'd have better luck using regex than using a simple match.
XPath match doesn't seem to work here -- probably due to the asterisks in the content. It will only work for something at the very beginning of the element, but once there's an asterisk in the text, it won't match. For example, I can match ISA if I turn on the wildcards option (by matching on "ISA*"), but I can't match on, say, ISA*00.
Thanks.