RegularExpressions.txt

These regular expressions have been tested for validating numeric patterns.
The topmost expression in each section is current best.

xs:float
http://www.w3.org/TR/xmlschema11-2/#float

(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN

INF (infinity) and NaN (Not A Number) are not part of the allowed range of field values in the X3D specification

(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?


BoundingBox

((\-1 \-1 \-1)|(((\+)?\.[0-9]+((E|e)(\+|\-)?[0-9]+)?|(\+)?[0-9]+(\.[0-9]*)?((E|e)(\+|\-)?[0-9]+)?) ((\+)?\.[0-9]+((E|e)(\+|\-)?[0-9]+)?|(\+)?[0-9]+(\.[0-9]*)?((E|e)(\+|\-)?[0-9]+)?) ((\+)?\.[0-9]+((E|e)(\+|\-)?[0-9]+)?|(\+)?[0-9]+(\.[0-9]*)?((E|e)(\+|\-)?[0-9]+)?)))?


Color

positive, range [0..1]

((( )*(\+)?(\.[0-9]+|0+(\.[0-9]*)?|0*1(\.[0]*)?)((E|e)(\+|\-)?([0-9]+))?){3})?( )*

(( )*(\+)?(\.[0-9]+|0+(\.[0-9]*)?|0*1(\.[0]*)?)((E|e)(\+|\-)?([0-9]+))?( )*(\+)?(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*(\+)?(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*)?

(( )*(\+)?(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*(\+)?(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*(\+)?(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*)?

(( )*(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*)?

(( )*(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?) (\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?) (\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*)?

(( )*(\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?) (\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?) (\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*)?

((\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?) (\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?) (\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*(,( )*)?)?


Colors

((( )*(\+)?(\.[0-9]+|0+(\.[0-9]*)?|0*1(\.[0]*)?)((E|e)(\+|\-)?([0-9]+))?){3}( )*(,( )*)?)*

((( )*(\+)?   (\.[0-9]+|0+(\.[0-9]*)?|0*1(\.[0]*)?)((E|e)(\+|\-)?([0-9]+))?){3}( )*(,( )*)?)*
((( )*(\+|\-)?(\.[0-9]+|         0*[0-9]+(\.[0]*)?)((E|e)(\+|\-)?([0-9]+))?){2}( )*(,( )*)?)*  v2fa

(((\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*){3}(,( )*)?)*

((\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?) (\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?) (\.[0-9]+|0(\.[0-9]*)?|1(\.[0]*)?)( )*(,( )*)?)*



Vector2FloatArray

((( )*(\+|\-)?(\.[0-9]+|0*[0-9]+(\.[0]*)?)((E|e)(\+|\-)?([0-9]+))?){2}( )*(,( )*)?)*

(\s*(\+|\-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)((E|e)(\+|\-)?[0-9]+)?\s+((\+|\-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)((E|e)(\+|\-)?[0-9]+)?)(,\s*|\s+,\s*|\s*)?)*


Vector3FloatArray

((( )*(\+|\-)?(\.[0-9]+|0*[0-9]+(\.[0]*)?)((E|e)(\+|\-)?([0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