03-13-2013 04:31 AM
Ciao a tutti,
premetto che é la prima volta che scrivo in questo forum, nel caso infrangessi qualche regola vi prego di farmelo notare
sto usando il la funzione "Search Replace" in modalitá "Regular Expression" per verificare che una stringa in ingresso abbia il giusto formato.
La stringa in questione é la seguente
"[Points]"
con le reg ex "^\d+\.\d+(E[+-]\d+)* \s+\d+\.\d+(E[+-]\d+)*" voglio verificare che le stringe siano nel formato
"5.00000000000000E-0001 4.29787368774414E+0001 07.03.2013 11:28:04"
(Trovate in allegato il codice che sto usando con il relativo debug)
in teoria avendo in ingresso la stringa "[Points]", la reg ex non dovrebbe avere alcun match, invece la funzione im ritorna "s"
ho verificato che dipende dal fatto che ho usato "\s+" nella reg ex, ma "\s" dovrebbe significare uno spazio, non la lettera "s"
sono io che ho capito male il funzionamento delle reg ex, o labview sbaglia la comparazione?
Grazie a tutti
03-13-2013 04:43 AM
03-13-2013 05:00 AM
Thanks for answering
this is not what I am looking for
if I have "[Points]" as input string, your solution will provide a result that I don't need.
In any case I do not understand why the regex does not give to me the expected result in case of "[Points]" input string
03-13-2013 05:03 AM
03-13-2013 05:06 AM - edited 03-13-2013 05:21 AM
this could be a possibility
but it still does not explain the behavior of the "search" palette
why does the palette match the "s"?
in any case, your suggestion is much better than my solution. I already implemented it, and it works like a charm
Thank you
03-13-2013 08:47 AM