Hyperledger Modeling 语言器中 double 的正则表达式

Regex for double in Hyperledger Modeling languager

有没有一种方法可以在 Hyperledger 中验证货币,我知道可以使用正则表达式来验证字符串值,但是在对 Double 数据类型使用正则表达式时出现错误。

这是出错的原因,它抱怨客户定义中的一行

participant Customer{
 o Double balance regex=/^[0-9]+(\.[0-9]{1,2})?/
}

但这行得通(如果数据类型是 String 而不是 Double)

participant Customer{
 o String balance regex=/^[0-9]+(\.[0-9]{1,2})?/
}

正则表达式仅对 Composer 中的字符串有效。

双精度、长整型或整数字段可以包含一个可选的范围表达式,用于验证字段的内容。