LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is regular expression can help me ?

Hello,
 
i need help i have the expression (string) " _0.0+_0.[0-9](0|5)0*_0.[0-9]0*_(0|1)_1.0+_" and from here i need to get that the range is 0-1 with steps of 0.1.
 
someone have an idea how can i do that?
0 Kudos
Message 1 of 3
(2,651 Views)

Can you give a little more idea of where this "expression" came from and what functions you are trying to use it with?  It looks vaguely like some of the advanced string searching format specifiers.  But if it is that, I don't understand how it relates to "the range 0-1 with steps of 0.1".

Please give more details on what you are trying to do.

0 Kudos
Message 2 of 3
(2,644 Views)

The string is a part of XML file , i will give u another exmple:

This is the original range 

<xs:element name="xxxxx">
                    <xs:simpleType>
                     <xs:restriction base="xs:decimal">
                      <xs:pattern value="0"/>
                      <xs:pattern value="0.0+"/>
                      <xs:pattern value="\-0.[1-9]0*"/>
                      <xs:pattern value="\-[1-9]"/>
                      <xs:pattern value="\-[1-9].[0-9]0*"/>
                      <xs:pattern value="\-1[0-9]"/>
                      <xs:pattern value="\-1[0-9].[0-9]0*"/>
                      <xs:pattern value="\-20"/>
                      <xs:pattern value="\-20.0+"/>
                     </xs:restriction>

you can see i have mached the numbers so i have now _0_0.0+_\-0.[1-9]0*_\-[1-9]_\-[1-9].[0-9]0*_\-1[0-9]_\-1[0-9].[0-9]0*_\-20_\-20.0+_

Those nambers indicate the range values that can be used by the parameter xxx, the numbers mean ranges possible to insert:

for exsample "-1[0-9].[0-9]0*" mean that you can enter  -10.00 till -19.90.

just so u will know this parameter value range should be 0-(-20) with steps of 0.1

By the way this is a simple pattern i still dont know what will i do with those ranges:

 <xs:element name="xxxxxxxxxx" >
                    <xs:simpleType>
                     <xs:restriction base="xs:decimal">
                      <xs:pattern value="[0-9]"/>
                      <xs:pattern value="[0-9].(0|5)0*"/>
                      <xs:pattern value="[1-5][0-9]"/>
                      <xs:pattern value="[1-5][0-9].(0|5)0*"/>
                      <xs:pattern value="6[0-3]"/>
                      <xs:pattern value="6[0-3].(0|5)0*"/>
                      <xs:pattern value="\-0.50*"/>
                      <xs:pattern value="\-[1-9]"/>
                      <xs:pattern value="\-[1-9].(0|5)0*"/>
                      <xs:pattern value="\-[1-5][0-9]"/>
                      <xs:pattern value="\-[1-5][0-9].(0|5)0*"/>
                      <xs:pattern value="\-6[0-3]"/>
                      <xs:pattern value="\-6[0-3].(0|5)0*"/>
                      <xs:pattern value="\-64"/>
                      <xs:pattern value="\-64.0+"/>
                      <xs:pattern value="\-[4-9][0-9]"/>
                      <xs:pattern value="\-[4-9][0-9].(0|00|25|5|50|75)0*"/>
                      <xs:pattern value="\-10[0-3]"/>
                      <xs:pattern value="\-10[0-3].(0|00|25|5|50|75)0*"/>
                      <xs:pattern value="50"/>
                      <xs:pattern value="50.0+"/>
                      <xs:pattern value="[1-9](00|50)"/>
                      <xs:pattern value="[1-9](00|50).0+"/>
                      <xs:pattern value="[1-5][0-9](00|50)"/>
                      <xs:pattern value="[1-5][0-9](00|50).0+"/>
                      <xs:pattern value="6[0-7](00|50)"/>
                      <xs:pattern value="6[0-7](00|50).0+"/>
                      <xs:pattern value="6800"/>
                      <xs:pattern value="6800.0+"/>
                     </xs:restriction>

 

0 Kudos
Message 3 of 3
(2,639 Views)