I’m really crap at regexp. I have the need to search a SMAT (file) with a regexp for DFT messages that have 18, 19 or 20 FT1 segments. (Don’t ask why, it’s a long story).
So I started with
(rFT1.*?){18}
which kinda works, but gives me all messages that have at least 18 FT1 messages.
Searched the internet for help and tried some things, but none work:
(rFT1.*?){18,20}?$
(rFT1.*?){18,20}(?=r)
(rFT1.*?){18}((rFT1.*?){2})?
(?<=[^(rFT1.*?)]|^)((rFT1.*?){18})(?:[^(rFT1.*?)]|$)
Is there a regexp that will add all messages with 18, 19 or 20 FT1 segments? Or for exactly 18 FT1 segments?
While typing this question, I figured out that I can first add the messages with at least 18 FT1 segments and then remove all messages with at least 21 FT1 segments. Duh… But maybe there is a regexp that can do this in one go.
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands