LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable special characters in Match Pattern function

Hi,

 

I'm currently programming a parser but the parsed text sometimes contains special characters like "?"  for example

As a consequence, to match this expression I shoud force the "\" before this char.

 

Is there a way to simply disable the special characters in the Match Pattern.vi ? It'd avoid me to write a program to add "\" before any special char of my text...

 

 

Thank you in advance for your help.

 

 

 Bim

0 Kudos
Message 1 of 6
(3,531 Views)
You should try using Search/Split String instead.  It doesn't use any special format characters in the search string.  The only con is it doesn't have the match and rest of string separated.
Message 2 of 6
(3,526 Views)

I don't see the problem with having these characters in the 'string' being searched by Match Pattern.  Are you wiring these into the 'regular expression' input?  Perhaps I'm misreading your explanation; could you post an example?

 

Jim

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

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

Hi,

 

If you use regular expression you don't have the choice to put "\" before any special character, it's the regular expression syntax.

 

Thanks to use NI forums.

0 Kudos
Message 4 of 6
(3,489 Views)

Would it work to use the "Search and Replace String"-function?

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 6
(3,483 Views)

Finally I get a result by adding "\" on these characters : [\.\?\\\^\[\]\+\*\$]

 

Thank you for your help

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