Suggestion: Regular expressions for Data Types

Imported from previous forum

[ original email was from John Prewett - jprewett@lavatrading.com ]
It would be useful for field-level validation if each data type included an optional regular expression. While some data types aren't useful to model with a regular expression(example:String), many are. Most languages have a regular expression processor available and it would then make validation very easy. For those of you who are familiar with regular expressions, here is a reasonable attempt at one for MonthYear: ^[0-9]{4}((0[1-9])|(1[0-2]))$ For those who aren't familiar with regular expressions, here is a link to an explanation: http://www.zytrax.com/tech/web/regex.htm Thanks JohnP

John,

The new metamodel we are proposing actually proposes to use XML Schema datatypes to define the FIX datatypes which will provide this exact same functionality. If you look at the FIXML schema version of FIX - you will see many of these are already defined. The use of XML Schema datatypes is a common practice in the industry - it also avoids having to specify which flavor of regular expression is being used.

As this is part of the metamodel proposal to be presented next week - this will certainly become a well discussed topic.

It would be useful for field-level validation if each data type included
an optional regular expression. While some data types aren’t useful to
model with a regular expression(example:String), many are.

Most languages have a regular expression processor available and it
would then make validation very easy.

For those of you who are familiar with regular expressions, here is a
reasonable attempt at one for MonthYear: [1]{4}((0[1-9])|(1[0-2]))$
For those who aren’t familiar with regular expressions, here is a link
to an explanation: Zytrax Tech Stuff - Regular Expressions - A Gentle User Guide and Tutorial

Thanks

JohnP


  1. 0-9 ↩︎