09-20-2012 09:44 AM
I think this is more like the Excel board where we can ask questions. At least that's how I've used it..
09-20-2012 01:13 PM
@smercurio_fc wrote:
But then regular expressions are pure gibberish to me anyway, so it's not that big a of surprise. I get a headache every time I look at them or have to use them.
"Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems."
09-20-2012 08:45 PM
Amen to that - I have to put a detailed explanation next to each Regex value, because I know in six months time when I go back to look at it I'll be thinking what the hell is that doing!!
P.S. Sorry if this was not the proper thread to be asking questions on Regular Expressions.
Chris
10-23-2012 12:43 AM
I just found out the hard way (scratching my head in a 15min debugging session) that character class negation is different between the Match Pattern Function and the Match Regular Expression Function.
Here's an example from the Help Docs:
Match Pattern Function:
One or more characters other than digits [~0-9]+
Match Regular Expression Function:
One or more characters other than digits [^0-9]+
Character class negation is the tilde for Match Pattern, and the caret for Match Regular Expression (and the rest of humanity).
If anyone can offer a history lesson on the legacy of tilde usage (calling all Darins ) feel free to hop in
10-23-2012 01:01 PM
Match Pattern with [^0-9] will give you the displayable characters which are not 0-9, sort of pseudo-negation.
As for a history lesson: Rolf and I had a very interesting discussion about this particular feature. There was an evolution between LV7 and LV9, very annoying.
http://forums.ni.com/t5/LabVIEW/Bug-in-Match-Pattern-in-LabVIEW-2010/m-p/1488048#M561533
10-26-2012 08:28 AM - edited 10-26-2012 08:28 AM
Here is a basic regEx which can be used to extract command and value from a string.
It has to work on the fact that the script is written by different people and the syntax may / will have variations.
For instance value / seperator / command,
where the seperator can be a white space or a comma: , or \s or \t or ,\s or ,\t
or in a wose case scenario: ,\s\t
There are other ways of doing this, but can quickly become messy...
10-26-2012 09:15 AM - edited 10-26-2012 09:21 AM
I wrote a Rube Goldberg expression.
It could have been simplified to :
[0-9]+[, \t \s]+
And the expression can be extended to include the command:
in the format : command \ delimiter \ value \ delimiter \ operation
10-29-2012 12:01 PM - edited 10-29-2012 12:02 PM
@Ray.R wrote:
I wrote a Rube Goldberg expression.
It could have been simplified to :
[0-9]+[, \t \s]+
And the expression can be extended to include the command:
in the format : command \ delimiter \ value \ delimiter \ operation
Don't forget that the search and replace has a regex option...
10-30-2012 10:15 AM
very nice Paul.
Thanks
02-01-2013 08:35 AM
From Philip Brooks: