Re: Help for XML pattern

Discussion in 'XML' started by Martin Honnen, Mar 25, 2010.

  1. Pizza67 wrote:
    > Hi all,
    >
    > I need to define a new string-based simple type that allows the following
    > patterns:
    >
    > String1 (that can be composed by any combination of [0-9], [A-Z] or [a-z] )
    >
    > or
    >
    > String1.String2 (where String1 and String2 are separated by a period (.) and
    > can be both composed by any combination of [0-9], [A-Z] or [a-z] ).
    >
    > So possible allowed values can be:
    >
    > 123456
    > qwerty
    > M000123
    > XXy123aah8829HJ00289jkjksls
    >
    > or
    >
    > abcdef.7890bH0
    > zeZ001.123F55
    >
    > Can someone please suggest what pattern should I use to enable such
    > restriction?


    [a-zA-Z0-9]*(\.[a-zA-Z0-9]+)?

    That would allow the empty string too but you can of course change it to

    [a-zA-Z0-9]+(\.[a-zA-Z0-9]+)?

    to require at least one character.

    --

    Martin Honnen
    http://msmvps.com/blogs/martin_honnen/
     
    Martin Honnen, Mar 25, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    17
    Views:
    1,936
    Chris Uppal
    Nov 16, 2005
  2. sunny
    Replies:
    1
    Views:
    481
    Salt_Peter
    Dec 7, 2006
  3. Pallav singh
    Replies:
    0
    Views:
    412
    Pallav singh
    Jan 22, 2012
  4. Pallav singh
    Replies:
    0
    Views:
    434
    Pallav singh
    Jan 22, 2012
  5. Pallav singh
    Replies:
    1
    Views:
    474
    Peter Remmers
    Jan 22, 2012
Loading...

Share This Page