LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Match pattern bug

 

Today I was debugging one of my parsing scripts and found that "match pattern" subvi doesn't handle properly ASCII symbol 91 which is "[" but does work with ASCII symbol 93 "]".

Dear NI representatives, could you report that bag to your developers please?

And please don't try to persuade me that it is "by design" Smiley Very Happy

Labview version 2012

 

 

 

labview_match pattern.jpg

 

labview_match pattern_bug.jpg

0 Kudos
Message 1 of 22
(1,472 Views)

It's by design Smiley Happy

 

The brackets are special characters that are there to indicate ranges. If you want to search for the bracket you need the escape character first. Try "\[".



CLA
www.dvel.se
Message 2 of 22
(1,464 Views)

@Abdulaev_Rustam wrote:

 

Today I was debugging one of my parsing scripts and found that "match pattern" subvi doesn't handle properly ASCII symbol 91 which is "[" but does work with ASCII symbol 93 "]".

Dear NI representatives, could you report that bag to your developers please?

And please don't try to persuade me that it is "by design" Smiley Very Happy

Labview version 2012

 

 

 

labview_match pattern.jpg

 

labview_match pattern_bug.jpg



I guess M_Peeker is trying to persuade you that it was "by design."  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 22
(1,414 Views)

This is not a bug, it is expected behavior. Look at the following link (first and second table rowa) and you will see that only for the opening bracket you need the escape character. For the closing bracket Match Pattern will do the litteral match. 

 

Ben64

 

http://www.regular-expressions.info/reference.html

 

 

Did it persuade you that it is "by design"Smiley Very Happy

--------------------------------------------------
The best way to say thanks is to give kudos!
0 Kudos
Message 4 of 22
(1,395 Views)

Hai I have the same problem here. Did you find a soulution. I am not able to search "[" in the match regular expression. It returns a empty string. If you have a solution it would be nice if you could write me a mail or post in the forum. 

 

Regards

 

0 Kudos
Message 5 of 22
(1,307 Views)

The solution is here.  Seriously, did you stop to read the post above yours?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 22
(1,294 Views)

The answer is already provided above.

 

To scan for the literal "[", you must escape it by adding a backslash in front like this: "\["

 

The [ without an escape indicates a range to be searched, such as [0-9] would look for digits zero through nine.

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 7 of 22
(1,288 Views)

Thanks. I did try all those before some how there was a mistake. Now it works. Thank you.

 

With regards

 

0 Kudos
Message 8 of 22
(1,282 Views)

Hai here is another problem in the Match pattern. How come when I put the same in a array and try to match the string through match pattern but gives a false result. 

 

I would like to in this case for example if the string in the input array and the string in the regular expression match then a string should be added "001]" to it. In the vi which I am posting. It does not recognize when it is with the left brackt. When without bracket it does. 

 

here in this case the string in the input array "[Step" should be seen as "[Step001]" in the output array. Can any one give a solution. 

0 Kudos
Message 9 of 22
(1,268 Views)

Your VI doesn't have any data in any of the controls.  You need to put data in the controls, save them as default, then save and attach the VI to your post.

 

Without data to work on, there is no way we can troubleshoot your problem.

0 Kudos
Message 10 of 22
(1,256 Views)