Update name regex to support all supported locales.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-01-03 11:02:24 +02:00
parent 0467033855
commit c79c4ed256
4 changed files with 8 additions and 5 deletions

View File

@ -42,7 +42,7 @@
</xs:element> </xs:element>
<xs:simpleType name="shortName"> <xs:simpleType name="shortName">
<xs:restriction base="xs:string"> <xs:restriction base="xs:string">
<xs:pattern value="^([^0-9*/^+\-=\s()?%:;!.,`'\&quot;]){1,1}([^*/^+\-=\s()?%:;!.,`'\&quot;]){0,}$"/> <xs:pattern value="^([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\-()+=?:;'\&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\-()+=?:;\&quot;]){0,}$"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:simpleType name="formatVersion"> <xs:simpleType name="formatVersion">

View File

@ -475,7 +475,7 @@
</xs:element> </xs:element>
<xs:simpleType name="shortName"> <xs:simpleType name="shortName">
<xs:restriction base="xs:string"> <xs:restriction base="xs:string">
<xs:pattern value="^([^0-9*/^+\-=\s()?%:;!.,`'\&quot;]){1,1}([^*/^+\-=\s()?%:;!.,`'\&quot;]){0,}$"/> <xs:pattern value="^([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\-()+=?:;'\&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\-()+=?:;\&quot;]){0,}$"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:simpleType name="units"> <xs:simpleType name="units">

View File

@ -43,7 +43,7 @@
</xs:element> </xs:element>
<xs:simpleType name="shortName"> <xs:simpleType name="shortName">
<xs:restriction base="xs:string"> <xs:restriction base="xs:string">
<xs:pattern value="^([^0-9*/^+\-=\s()?%:;!.,`'\&quot;]){1,1}([^*/^+\-=\s()?%:;!.,`'\&quot;]){0,}$"/> <xs:pattern value="^([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\-()+=?:;'\&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\-()+=?:;\&quot;]){0,}$"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:simpleType name="units"> <xs:simpleType name="units">

View File

@ -93,8 +93,11 @@ QT_WARNING_DISABLE_GCC("-Wattributes")
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
inline QString NameRegExp() inline QString NameRegExp()
{ {
//Same regexp in pattern.xsd shema file. Don't forget synchronize. //Same regexp in pattern.xsd shema file. Don't forget to synchronize.
return QStringLiteral("^([^0-9*/^+\\-=\\s()?%:;!.,`'\"]){1,1}([^*/^+\\-=\\s()?%:;!.,`\"]){0,}$"); // \p{Nd} - \p{Decimal_Digit_Number}
// \p{Zs} - \p{Space_Separator}
// Note. All three minus characters are different!
return QStringLiteral("^([^\\p{Nd}\\p{Zs}*/&|!<>^\\-()+=?:;'\"]){1,1}([^\\p{Zs}*/&|!<>^\\-()+=?:;\"]){0,}$");
} }
QT_WARNING_POP QT_WARNING_POP