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: 

regular expression (*, +)

Solved!
Go to solution

Hi,

 

 

I have a simple but complicated question on regular expression using star(*) and (+).


When I wanted to detect a floating number, I used [-+]?[0-9]+\.?[0-9]+ but found [-+]?[0-9]*\.?[0-9]+ is more popular in expert people.


In this expression, * was used in the decimal part but + used in the floating part.

 

In definition, * can exclude a character itself but + need to get the number definitely.


Can you give me wrong example for "[-+]?[0-9]+\.?[0-9]+" which can detect a number rightly by "[-+]?[0-9]*\.?[0-9]+ " ?

 

labmaster.

0 Kudos
Message 1 of 3
(3,466 Views)
Solution
Accepted by topic author labmaster

.14 will be detected by the 2nd but not the first.

I'd probably use * on the fractional part also.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 3
(3,435 Views)
wow.. thanks. I understand it clearly
0 Kudos
Message 3 of 3
(3,417 Views)