LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search And Replace Patter VI

Solved!
Go to solution

I'm struggling with using the search and replace patter to replace a number of substring matches within a string, can anyone help and tell me what am I doing worng? Not an expert in regexps

 

I'm basically trying to replace all the matches for "NONE","none" or "normal" with "OK within the "1NONE2none3normal4" string

 

regexp.png

 

 

Thanks

0 Kudos
Message 1 of 6
(3,595 Views)
Solution
Accepted by topic author icastillejos

1. Ditch that VI and use Search and Replace String instead

2. Right-click and select 'Regular Expression'

3. Wire True to Replace all and Ignore Case

4.  Search string = (none|normal)

Message 2 of 6
(3,588 Views)

Awesome, that works

 

Could this possibly be a bug or perhaps I'm not using it the right VI to solve my problem?

 

Thanks!

0 Kudos
Message 3 of 6
(3,576 Views)

@icastillejos wrote:

Awesome, that works

 

Could this possibly be a bug or perhaps I'm not using it the right VI to solve my problem?

 

Thanks!


You're not using it correclty. The Match Pattern within this VI does not fully support regular expressions.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 6
(3,563 Views)

Well I just chcked the detailed documentation and there is nothing about the limitations which leads me to believe otherwise... anyway I solved my issue

 

Thanks!

0 Kudos
Message 5 of 6
(3,558 Views)

From the help on for the "Match Patern" VI: "This function is similar to the Search and Replace Pattern VI. The Match Pattern function gives you fewer options for matching strings but performs more quickly than the Match Regular Expression function. For example, the Match Pattern function does not support the parenthesis or vertical bar (|) characters." The "Search and Replace Pattern.vi" uses Match Pattern internally.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 6
(3,513 Views)