LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

possible bug in match pattern in string for dot and Special Character

Solved!
Go to solution

hi friend recently i find some thing in match pattern string that it look like bug I want to know labveiw expert opinion about it 
the possible bug is that
did you ever try to match (.) dot for use it in regular expression ? this icon could not find dot inside the string ?!!
also I think what if we try to find a character inside a string that is piece of Special Character
for example how you can use this icon for finding \b inside string like( hatef\blabview )?!

0 Kudos
Message 1 of 7
(5,533 Views)

@Hatef wrote:

" how you can use this icon for finding \b inside string like( hatef\blabview )?!"


What "icon" are you talking about?

 

Can you post a VI that contains examples of strings and how you are searching them that makes you think there might be a bug?

0 Kudos
Message 2 of 7
(5,530 Views)

this is vi for match . and \b

0 Kudos
Message 3 of 7
(5,502 Views)

And why do you think there is a bug?  What do you expect the results to be?

 

Did you read the help for Match Pattern, and drill down and find the help article "Special Characters for Match Regular Expression and Search and Replace String".

 

A period means "Matches any single character except a newline character. Within square brackets, . is literal."

 

A \b means "

  • \b - Represents a word boundary. A word boundary is a character that is not a word character adjacent to a character that is a word character and vice versa. A word character is an alphanumeric character or an underscore (_). For example, \bhat matches hat in hatchet but not in that. hat\b matches hat in that but not in hatchet. \bhat\b matches hat in hat but not in that or hatchet."

The results seem to be exactly what the help file is describing.

0 Kudos
Message 4 of 7
(5,490 Views)

than you for answer  RavensFan but I get a bit confused with your answer  could you make a simple example vi to solve this problem?
problem is that
find( .) position (or offset) inside this string(  hatef.labview)
find (\b ) position (or offset) inside this string(  hatef\blabview)
I try use match pattern and I could not solve it 
?!
your solution should find position or offset 5  for . and \b

 

 

0 Kudos
Message 5 of 7
(5,477 Views)
Solution
Accepted by topic author Hatef.fouladi

[.] to find the period

 

\\b to find the backslash b

Message 6 of 7
(5,456 Views)

thank you for your answer 
it realy work 

0 Kudos
Message 7 of 7
(5,448 Views)