473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

XSD alphanumerical, reg_exp

Hello.

As a greenhorn i've got some new questions...

Is there any type in XSD for alphanumerical strings?
if not:
What is XSD pattern for alphanumerical strings?
E.g. password: alphanumerical and lenght=6(at least)

And second thing(sorry ;D)

how can i write pattern for e-mail addres. pseudocode like this:
[alpha_num]'@'[alpha_num]'.com.pl'

thanks in advance
and once again sorry

greetings R
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
Jul 20 '05 #1
5 2577


Ruthless wrote:

Is there any type in XSD for alphanumerical strings?
if not:
What is XSD pattern for alphanumerical strings?
E.g. password: alphanumerical and lenght=6(at least)
Well, if alphanumerical means A-Z0-9 then the following is a way to
express that

<xs:element name="password" type="passwordType" />

<xs:simpleType name="passwordType">
<xs:restriction base="xs:string">
<xs:minLength value="6" />
<xs:pattern value="[a-zA-Z0-9]{6,}" />
</xs:restriction>
</xs:simpleType>
However many languages have more letters than A-Z so you might need to
extend the pattern, for instance with the letter ż

<xs:element name="password" type="passwordType" />

<xs:simpleType name="passwordType">
<xs:restriction base="xs:string">
<xs:minLength value="6" />
<xs:pattern value="[a-zA-Z0-9ż]{6,}" />
</xs:restriction>
</xs:simpleType>

Make sure you use an editor that is Unicode capable when you author the
XML schema file.

how can i write pattern for e-mail addres. pseudocode like this:
[alpha_num]'@'[alpha_num]'.com.pl'


While regular expressions are powerful I think they are not powerful
enough to write one that really matches all the possibilities the RFC
for email adresses allows.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
> > how can i write pattern for e-mail addres. pseudocode like this:
[alpha_num]'@'[alpha_num]'.com.pl'


While regular expressions are powerful I think they are not powerful
enough to write one that really matches all the possibilities the RFC
for email adresses allows.


OK but for the example pattern with '@' and ending: 'com.pl'

how it would be? I don't know regular expresions at all and i'm beginner in
XML

Maybe sth like this:
<xs:simpleType name="mail-type">
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9]{1,}[@][a-zA-Z0-9]{1,}['com.pl']" />
</xs:restriction>
</xs:simpleType>
?

thanks in advance
greetings R
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
Jul 20 '05 #3
In article <bs**********@atlantis.news.tpi.pl>,
Ruthless <ruthless@NO_SPAM.poczta.onet.pl> wrote:
% > > how can i write pattern for e-mail addres. pseudocode like this:
% > > [alpha_num]'@'[alpha_num]'.com.pl'
% >
% > While regular expressions are powerful I think they are not powerful
% > enough to write one that really matches all the possibilities the RFC
% > for email adresses allows.
%
% OK but for the example pattern with '@' and ending: 'com.pl'
%
% how it would be? I don't know regular expresions at all and i'm beginner in
% XML
%
% Maybe sth like this:
% <xs:simpleType name="mail-type">
% <xs:restriction base="xs:string">
% <xs:pattern value="[a-zA-Z0-9]{1,}[@][a-zA-Z0-9]{1,}['com.pl']" />
% </xs:restriction>
% </xs:simpleType>

This is no good. It doesn't allow, for instance, dots. It doesn't
append com.pl correctly. There are probably other problems. You could have

[a-zA-Z0-9._]+@[a-zA-Z0-9._]+com.pl

but it might be better to have

[^@\p{Z}]+@[^@\p{Z}]+com.pl

[^@\p{Z}] is the set of all characters except @ and space-type characters.

--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #4
thanx

greetings R

U¿ytkownik "Patrick TJ McPhee" <pt**@interlog.com> napisa³ w wiadomo¶ci
news:bs**********@news.eusc.inter.net...
In article <bs**********@atlantis.news.tpi.pl>,
Ruthless <ruthless@NO_SPAM.poczta.onet.pl> wrote:
% > > how can i write pattern for e-mail addres. pseudocode like this:
% > > [alpha_num]'@'[alpha_num]'.com.pl'


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
Jul 20 '05 #5


Patrick TJ McPhee wrote:
In article <bs**********@atlantis.news.tpi.pl>,
Ruthless <ruthless@NO_SPAM.poczta.onet.pl> wrote:
% > > how can i write pattern for e-mail addres. pseudocode like this:
% > > [alpha_num]'@'[alpha_num]'.com.pl'
% >
% > While regular expressions are powerful I think they are not powerful
% > enough to write one that really matches all the possibilities the RFC
% > for email adresses allows.
%
% OK but for the example pattern with '@' and ending: 'com.pl'
%

This is no good. It doesn't allow, for instance, dots. It doesn't
append com.pl correctly. There are probably other problems. You could have

[a-zA-Z0-9._]+@[a-zA-Z0-9._]+com.pl


It depends on what the original poster wants but I suspect the dot
between com.pl needs to be escaped
com\.pl

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Josema | last post by:
Hi to all, I have a datagrid filled with string values, and when i click in a header column the datagrid is alphanumerical sorted , but i need sort some columns by numeric way... The...
0
by: Hugo Coolens | last post by:
I want to order a text field which contains some words which begin with a single quote, if however I perform the following query, the single quote seems to be neglected: select arabic, dutch...
5
by: Dave | last post by:
#define BOOST_REGEX_DYN_LINK #include <iostream> #include <boost\regex.hpp> using namespace boost; using namespace std; int main() {
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
0
by: Wescotte | last post by:
<?php global $TABLE_GL_DATA; global $connect; $PREPARED_SQL = odbc_prepare($connect, "INSERT INTO $TABLE_GL_DATA VALUES (?,?,?,?,?,?,?)"); function Generate_GL_Data() {
0
by: teo | last post by:
Hallo, I need to match a word in its "absolute" way, that is with no alphanumerical chars before and after it : only blank spaces and interpuntuaction are accepted. I tried with myword
1
by: Zvonko Bi¹kup | last post by:
Hi! I want to check the text field if it contains only alphanumerical values and not space. But I use special characters in croatian language (iso-8852-2) and when you enter such a charactzer,...
2
by: DarthPeePee | last post by:
Hello everyone. I am working on a Password Strength Meter and I am running into 1 problem that I would like to fix. When pressing the "Clear Password & Try Again" button, the password clears...
2
by: jaka | last post by:
Hi, I'm in need of some expert help in sorting a numerical/alphanumerical employee ID field (5&6 characters in length). Also seperating the alphanumerical IDs and finding the gaps in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.