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:simpleType name="shortName">
<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:simpleType>
<xs:simpleType name="formatVersion">

View file

@ -475,7 +475,7 @@
</xs:element>
<xs:simpleType name="shortName">
<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:simpleType>
<xs:simpleType name="units">

View file

@ -43,7 +43,7 @@
</xs:element>
<xs:simpleType name="shortName">
<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:simpleType>
<xs:simpleType name="units">

View file

@ -93,8 +93,11 @@ QT_WARNING_DISABLE_GCC("-Wattributes")
//---------------------------------------------------------------------------------------------------------------------
inline QString NameRegExp()
{
//Same regexp in pattern.xsd shema file. Don't forget synchronize.
return QStringLiteral("^([^0-9*/^+\\-=\\s()?%:;!.,`'\"]){1,1}([^*/^+\\-=\\s()?%:;!.,`\"]){0,}$");
//Same regexp in pattern.xsd shema file. Don't forget to synchronize.
// \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