Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-05-26 21:05
Flavor·PCRE (Legacy)

/
(?=NM1\*03\*1\*).*?~((REF\*(?<refDepCode>\w{2,3})\*(?<refDepVal>.*?)~)*)
/
gms
Open regex in editor

Description

There are 2 segments within this data that start with REF* and end with a tilde (~). I can capture one of them but not both. I've read and cant seem to figure this one out. I DO need to preface with the NM1*03 piece.

Submitted by Chris.