LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Regular Expression for?

Solved!
Go to solution
What would be the regular expression for extracting "LEDsOnFront" from the string "PUME-TestModules-LEDsOnFront-VIT.vit" (quotations not included)?
0 Kudos
Message 1 of 3
(2,429 Views)
Solution
Accepted by topic author Rashid-Malik

Are you looking for whatever text is between PUME-TestModules- and -VIT.vit?  If so, try using Scan From String with a format specifier of "PUME-TestModules-%[^-]-VIT.vit".

Message 2 of 3
(2,389 Views)

Well, I'm not sure what you're trying to do. The obvious answer would be to use the litteral LEDsOnFront as regex. If you want to remove this from

the string you can use the "search and replace pattern.vi" with this regex and an empty string as replacement.


If you want to extract any text between PUME-TestModules- and -VIT.vit you can use the following regex: PUME-TestModules-\K[^-]*

[^-]* assume that the string you want to extract do not contain an hyphen, If the string you want to extract can contain an hyphen use the following regex instead: PUME-TestModules-\K.*(?=-VIT)


Ben64

Message 3 of 3
(2,374 Views)