From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate functionality of match pattern

Hi Nathand,

 

The characters that I want to match have from 1 to 4 characters prior to "XXX" and it could be a space in between as these examples:

LXXX 

AAXXX

CECUXXX 

SN XXX (space between SN and XXX)

 

They never start immediately after "<" as shown on these examples:

<TTT BYTE0x0000 ZZXXX CECUXXX AAXXX LXXX  or  <AX SN XXX V123.12[ZZ1]

 

 

In the first example string, I need to match all 4 occurrences. In the second one, only "SN XXX".  I need to return them in one string. Each of these strings are complete samples as shown above. Some short ones and some long ones as the one shown above. It may be 1000 of these strings and each of them represents a line in a file.

 

Thanks,

frn

 

 

0 Kudos
Message 11 of 13
(334 Views)

Again, spend some time reading about regular expressions. See if you can get it working on your own, and post if you get stuck. I do not think this problem requires a particularly complicated expression. I recommend using Match Regular Expression.

0 Kudos
Message 12 of 13
(329 Views)

Hi Nathand,

 

No problem, I will read more about regular expression to get proficient on this.  Thanks for your help.

 

0 Kudos
Message 13 of 13
(293 Views)