Regular expression of empty string

Discussion in 'XML' started by ST Wong, Apr 13, 2004.

  1. ST Wong

    ST Wong Guest

    Hi all,

    As metacharaters ^ and $ are not used in regular expression in XML,
    I'm looking for how to specify empty string.

    Would anyone please help?
    Thanks a lot.
    Regards,
    ST Wong
     
    ST Wong, Apr 13, 2004
    #1
    1. Advertising

  2. In article <>,
    ST Wong <> wrote:

    >As metacharaters ^ and $ are not used in regular expression in XML,
    >I'm looking for how to specify empty string.


    Assuming you mean XML Schema regular expressions, the empty regular
    expression matches only the empty string.

    -- Richard
     
    Richard Tobin, Apr 13, 2004
    #2
    1. Advertising

  3. ST Wong

    ST Wong Guest

    (Richard Tobin) wrote in message news:<c5hk9m$2gh0$>...
    > In article <>,
    > ST Wong <> wrote:
    >
    > >As metacharaters ^ and $ are not used in regular expression in XML,
    > >I'm looking for how to specify empty string.

    >
    > Assuming you mean XML Schema regular expressions, the empty regular
    > expression matches only the empty string.
    >
    > -- Richard


    Thanks.

    BTW, I've an xml file contains patterns for matching strings. It's
    okay to match non-null strings by specifying the regular expression in
    this way:

    <data>.+</data>

    But failed to match null string if I specify something like this:

    <data></data>

    Would you pls help?
    I'm new to XML and sorry for the naive question.

    Thanks again.
    Sincerely,
    ST Wong
     
    ST Wong, Apr 14, 2004
    #3
  4. In article <>,
    ST Wong <> wrote:

    >BTW, I've an xml file contains patterns for matching strings. It's
    >okay to match non-null strings by specifying the regular expression in
    >this way:
    >
    ><data>.+</data>
    >
    >But failed to match null string if I specify something like this:
    >
    ><data></data>
    >
    >Would you pls help?


    You haven't told us what program it is that is using these regular
    expressions. XML itself doesn't say anything about regular
    expressions.

    -- Richard
     
    Richard Tobin, Apr 14, 2004
    #4
  5. ST Wong

    ST Wong Guest

    (Richard Tobin) wrote in message news:<c5jlfe$3it$>...
    > In article <>,
    > ST Wong <> wrote:
    >
    > >BTW, I've an xml file contains patterns for matching strings. It's
    > >okay to match non-null strings by specifying the regular expression in
    > >this way:
    > >
    > ><data>.+</data>
    > >
    > >But failed to match null string if I specify something like this:
    > >
    > ><data></data>
    > >
    > >Would you pls help?

    >
    > You haven't told us what program it is that is using these regular
    > expressions. XML itself doesn't say anything about regular
    > expressions.
    >
    > -- Richard


    The file is used by Java programs.

    Sorry for missing such important information.

    Thanks again.
    /ST
     
    ST Wong, Apr 15, 2004
    #5
  6. In article <>,
    ST Wong <> wrote:

    >The file is used by Java programs.


    I think you need to refer to the Java regular expression
    documentation, rather than XML.

    -- Richard
     
    Richard Tobin, Apr 15, 2004
    #6
    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. VSK
    Replies:
    2
    Views:
    2,307
  2. =?iso-8859-1?B?bW9vcJk=?=

    Matching abitrary expression in a regular expression

    =?iso-8859-1?B?bW9vcJk=?=, Dec 1, 2005, in forum: Java
    Replies:
    8
    Views:
    851
    Alan Moore
    Dec 2, 2005
  3. GIMME
    Replies:
    3
    Views:
    11,974
    vforvikash
    Dec 29, 2008
  4. Tzury Bar Yochay
    Replies:
    1
    Views:
    406
    Gabriel Genellina
    Mar 24, 2008
  5. Savvoulidis Iordanis

    Empty gridview cells and checking for empty string

    Savvoulidis Iordanis, Sep 5, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    525
    Savvoulidis Iordanis
    Sep 5, 2008
Loading...

Share This Page