Re: xsd reg expression for not

Discussion in 'XML' started by Colin Mackenzie, Jun 30, 2003.

  1. oops, mesage sent too soon,

    so if you have a pattern that must not start with an A but can then have
    many characters use

    "[^A].+"

    not "this" seems to be rarher clumsily

    "[^t][^h][^i][^s].+"

    perhaps there is a better way

    Colin

    "Colin Mackenzie" <> wrote in message
    news:bdpnoj$heg$...
    > the reg ex for not is the ^ (shift 6 on my PC) charcater
    > "Red Ogden" <> wrote in message
    > news:...
    > > Please can anyone tell me the regex for Not
    > > E.g. I don't want the string to begin with 'this'??
    > > Thanks in advance
    > > Redge.

    >
    >
     
    Colin Mackenzie, Jun 30, 2003
    #1
    1. Advertising

  2. Colin Mackenzie

    Red Ogden Guest

    Many thanks again Colin - as you can no doubt gather I am new to reg
    expressions - I see what you mean about being clumsy - is it necessary
    to give a range for each letter? And would that mean that the string
    could not start with 't'?

    Thanks
    Redge.

    "Colin Mackenzie" <> wrote in message news:<bdpo4j$qtq$>...
    > oops, mesage sent too soon,
    >
    > so if you have a pattern that must not start with an A but can then have
    > many characters use
    >
    > "[^A].+"
    >
    > not "this" seems to be rarher clumsily
    >
    > "[^t][^h][^i][^s].+"
    >
    > perhaps there is a better way
    >
    > Colin
    >
    > "Colin Mackenzie" <> wrote in message
    > news:bdpnoj$heg$...
    > > the reg ex for not is the ^ (shift 6 on my PC) charcater
    > > "Red Ogden" <> wrote in message
    > > news:...
    > > > Please can anyone tell me the regex for Not
    > > > E.g. I don't want the string to begin with 'this'??
    > > > Thanks in advance
    > > > Redge.

    > >
    > >
     
    Red Ogden, Jul 1, 2003
    #2
    1. Advertising

  3. yes, it was clumsy and you are correct in saying that it would not alow
    "that" (because of the not "t").

    I was stuck so I put a question into the schema dev newsgroup.

    The basic answer is that whole strings cannot be negated in the current
    version of schema.

    Jeni Tennision however did come-up with the following work around however
    (Jenni's comments below). I simplified the string to negate to be "STR".
    I think you can use:

    (([^S].*)|(S[^T].*)|(ST[^R].*))

    in other words, the string can start with something that isn't S; or

    it can start with S, as long as it's followed by something that isn't

    T; or it can start with ST, as long as it's followed by something that

    isn't R.

    Cheers,

    Jeni

    ---

    Jeni Tennison

    http://www.jenitennison.com/



    "Red Ogden" <> wrote in message
    news:...
    > Many thanks again Colin - as you can no doubt gather I am new to reg
    > expressions - I see what you mean about being clumsy - is it necessary
    > to give a range for each letter? And would that mean that the string
    > could not start with 't'?
    >
    > Thanks
    > Redge.
    >
    > "Colin Mackenzie" <> wrote in message

    news:<bdpo4j$qtq$>...
    > > oops, mesage sent too soon,
    > >
    > > so if you have a pattern that must not start with an A but can then have
    > > many characters use
    > >
    > > "[^A].+"
    > >
    > > not "this" seems to be rarher clumsily
    > >
    > > "[^t][^h][^i][^s].+"
    > >
    > > perhaps there is a better way
    > >
    > > Colin
    > >
    > > "Colin Mackenzie" <> wrote in message
    > > news:bdpnoj$heg$...
    > > > the reg ex for not is the ^ (shift 6 on my PC) charcater
    > > > "Red Ogden" <> wrote in message
    > > > news:...
    > > > > Please can anyone tell me the regex for Not
    > > > > E.g. I don't want the string to begin with 'this'??
    > > > > Thanks in advance
    > > > > Redge.
    > > >
    > > >
     
    Colin Mackenzie, Jul 1, 2003
    #3
  4. Colin Mackenzie

    Red Ogden Guest

    Colin
    Many thanks for the further explanation and for Jenni's workaround.
    All the best
    Redge.
     
    Red Ogden, Jul 2, 2003
    #4
    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. Markus
    Replies:
    1
    Views:
    1,187
    Markus
    Nov 22, 2005
  2. Red Ogden

    xsd reg expression for wildcard

    Red Ogden, Jun 25, 2003, in forum: XML
    Replies:
    1
    Views:
    971
    Red Ogden
    Jun 26, 2003
  3. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    534
    C. M. Sperberg-McQueen
    Sep 26, 2003
  4. Replies:
    1
    Views:
    912
    Martin Honnen
    Jan 14, 2004
  5. Larry Woods
    Replies:
    2
    Views:
    104
    Larry Woods
    Sep 8, 2003
Loading...

Share This Page