ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Capture Multiple Line String using Regular Expression?

Solved!
Go to solution

Hi, 

 

I have a simple program like this:

 

regexvi.pngregexfp.png

 

What I want to accomplish is to capture everything between >>start and >>end using a single Match Regular Expression node. It seems that setting multiple? to True or False does not help.

I am using LabVIEW 2012.

 

If it is impossible to capture it using a single node, that is fine. But I want to make sure that I can make full use of this node without combining serveral others.

 

Thank you!

TailOfGon
Certified LabVIEW Architect 2013
0 Kudos
Message 1 of 3
(6,400 Views)
Solution
Accepted by topic author TailOfGon

>>start([\w\s]*)>>end

 

A dot matches any single character except line break characters.  You've got two of them.

 

efp.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 3
(6,392 Views)

Thank you for the fast response! Your solution worked in the example case 🙂

 

After I saw your post, I was finally able to step forward. But I still wanted to make use of dot notation due to the limitation of characters that match with \w. 

 

I made some more modification to your regular expression then now it seems working for all characters:

 

>>start((?:\s|.)*)>>end

regexfp1.png

 

Thanks!

 

TailOfGon
Certified LabVIEW Architect 2013
Message 3 of 3
(6,380 Views)