About a Regular Expression Grouping Construct

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laser Lu

    About a Regular Expression Grouping Construct

    Hello, everybody,
    do you know how to use this Grouping Construct?

    (?> )

    I've found its reference on MSDN, but still can not understand it totally.
    The following is its description:

    Nonbacktracking subexpression (also known as a "greedy" subexpression). The
    subexpression is fully matched once, and then does not participate piecemeal
    in backtracking. (That is, the subexpression matches only strings that would
    be matched by the subexpression alone.)

    Can anybody tell me how to use it? If someone knows, please show me an example:)
    Thanks a lot!

    Best regards,
    Laser Lu.



  • Daniel Groh

    #2
    Re: About a Regular Expression Grouping Construct

    in the visual studio u can try the RegularExpressi onValidator and there you
    can use your ExpString!

    "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
    news:4878363249 5855093125000@n ews.microsoft.c om...[color=blue]
    > Hello, everybody,
    > do you know how to use this Grouping Construct?
    >
    > (?> )
    >
    > I've found its reference on MSDN, but still can not understand it totally.
    > The following is its description:
    >
    > Nonbacktracking subexpression (also known as a "greedy" subexpression).
    > The subexpression is fully matched once, and then does not participate
    > piecemeal in backtracking. (That is, the subexpression matches only
    > strings that would be matched by the subexpression alone.)
    >
    > Can anybody tell me how to use it? If someone knows, please show me an
    > example:) Thanks a lot!
    >
    > Best regards,
    > Laser Lu.
    >
    >
    >[/color]


    Comment

    • Laser Lu

      #3
      Re: About a Regular Expression Grouping Construct

      Hello Daniel, thank you:)
      But I'd like to say that the RegularExpressi onValidator control is only available
      in ASP.NET Web Applications, and its built-in editor is simple. Both Regulator
      and Expresso are better than it.

      However, my question is what does the Grouping Construct '(?> )' mean? I
      just need a sample code on how to use this construct:)

      [color=blue]
      > in the visual studio u can try the RegularExpressi onValidator and
      > there you can use your ExpString!
      >
      > "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
      > news:4878363249 5855093125000@n ews.microsoft.c om...
      >[color=green]
      >> Hello, everybody,
      >> do you know how to use this Grouping Construct?
      >> (?> )
      >>
      >> I've found its reference on MSDN, but still can not understand it
      >> totally. The following is its description:
      >>
      >> Nonbacktracking subexpression (also known as a "greedy"
      >> subexpression). The subexpression is fully matched once, and then
      >> does not participate piecemeal in backtracking. (That is, the
      >> subexpression matches only strings that would be matched by the
      >> subexpression alone.)
      >>
      >> Can anybody tell me how to use it? If someone knows, please show me
      >> an example:) Thanks a lot!
      >>
      >> Best regards,
      >> Laser Lu.[/color][/color]



      Comment

      • Jakob Christensen

        #4
        Re: About a Regular Expression Grouping Construct

        You can use the grouping construct for extracting parts of a string. For
        example, say you want to extract the value of color (i.e. "red") from the
        following string:

        string description color="red"

        You can do this using the regular expression: color="(?<color >\S*)"

        The following code uses the regular expression and the Match.Groups property
        to print out the value "red":

        Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
        Match m = rgx.Match("a string description color=\"red\"") ;
        if (m.Success)
        {
        string color = m.Groups["color"].Value;
        Console.WriteLi ne(color);
        }

        HTH, Jakob.



        "Laser Lu" wrote:
        [color=blue]
        > Hello Daniel, thank you:)
        > But I'd like to say that the RegularExpressi onValidator control is only available
        > in ASP.NET Web Applications, and its built-in editor is simple. Both Regulator
        > and Expresso are better than it.
        >
        > However, my question is what does the Grouping Construct '(?> )' mean? I
        > just need a sample code on how to use this construct:)
        >
        >[color=green]
        > > in the visual studio u can try the RegularExpressi onValidator and
        > > there you can use your ExpString!
        > >
        > > "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
        > > news:4878363249 5855093125000@n ews.microsoft.c om...
        > >[color=darkred]
        > >> Hello, everybody,
        > >> do you know how to use this Grouping Construct?
        > >> (?> )
        > >>
        > >> I've found its reference on MSDN, but still can not understand it
        > >> totally. The following is its description:
        > >>
        > >> Nonbacktracking subexpression (also known as a "greedy"
        > >> subexpression). The subexpression is fully matched once, and then
        > >> does not participate piecemeal in backtracking. (That is, the
        > >> subexpression matches only strings that would be matched by the
        > >> subexpression alone.)
        > >>
        > >> Can anybody tell me how to use it? If someone knows, please show me
        > >> an example:) Thanks a lot!
        > >>
        > >> Best regards,
        > >> Laser Lu.[/color][/color]
        >
        >
        >
        >[/color]

        Comment

        • Laser Lu

          #5
          Re: About a Regular Expression Grouping Construct

          Hello Jakob,
          Actually I wan to know what does "(?> )" mean? :)
          [color=blue]
          > You can use the grouping construct for extracting parts of a string.
          > For example, say you want to extract the value of color (i.e. "red")
          > from the following string:
          >
          > string description color="red"
          >
          > You can do this using the regular expression: color="(?<color >\S*)"
          >
          > The following code uses the regular expression and the Match.Groups
          > property to print out the value "red":
          >
          > Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
          > Match m = rgx.Match("a string description color=\"red\"") ;
          > if (m.Success)
          > {
          > string color = m.Groups["color"].Value;
          > Console.WriteLi ne(color);
          > }
          > HTH, Jakob.
          >
          > "Laser Lu" wrote:
          >[color=green]
          >> Hello Daniel, thank you:)
          >> But I'd like to say that the RegularExpressi onValidator control is
          >> only available
          >> in ASP.NET Web Applications, and its built-in editor is simple. Both
          >> Regulator
          >> and Expresso are better than it.
          >> However, my question is what does the Grouping Construct '(?> )'
          >> mean? I just need a sample code on how to use this construct:)
          >>[color=darkred]
          >>> in the visual studio u can try the RegularExpressi onValidator and
          >>> there you can use your ExpString!
          >>>
          >>> "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
          >>> news:4878363249 5855093125000@n ews.microsoft.c om...
          >>>
          >>>> Hello, everybody,
          >>>> do you know how to use this Grouping Construct?
          >>>> (?> )
          >>>> I've found its reference on MSDN, but still can not understand it
          >>>> totally. The following is its description:
          >>>>
          >>>> Nonbacktracking subexpression (also known as a "greedy"
          >>>> subexpression). The subexpression is fully matched once, and then
          >>>> does not participate piecemeal in backtracking. (That is, the
          >>>> subexpression matches only strings that would be matched by the
          >>>> subexpression alone.)
          >>>>
          >>>> Can anybody tell me how to use it? If someone knows, please show me
          >>>> an example:) Thanks a lot!
          >>>>
          >>>> Best regards,
          >>>> Laser Lu.[/color][/color][/color]



          Comment

          • Jakob Christensen

            #6
            Re: About a Regular Expression Grouping Construct

            You can use the grouping construct for extracting parts of a string. For
            example, say you want to extract the value of color (i.e. "red") from the
            following string:

            string description color="red"

            You can do this using the regular expression: color="(?<color >\S*)"

            The following code uses the regular expression and the Match.Groups property
            to print out the value "red":

            Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
            Match m = rgx.Match("a string description color=\"red\"") ;
            if (m.Success)
            {
            string color = m.Groups["color"].Value;
            Console.WriteLi ne(color);
            }

            HTH, Jakob.



            "Laser Lu" wrote:
            [color=blue]
            > Hello Daniel, thank you:)
            > But I'd like to say that the RegularExpressi onValidator control is only available
            > in ASP.NET Web Applications, and its built-in editor is simple. Both Regulator
            > and Expresso are better than it.
            >
            > However, my question is what does the Grouping Construct '(?> )' mean? I
            > just need a sample code on how to use this construct:)
            >
            >[color=green]
            > > in the visual studio u can try the RegularExpressi onValidator and
            > > there you can use your ExpString!
            > >
            > > "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
            > > news:4878363249 5855093125000@n ews.microsoft.c om...
            > >[color=darkred]
            > >> Hello, everybody,
            > >> do you know how to use this Grouping Construct?
            > >> (?> )
            > >>
            > >> I've found its reference on MSDN, but still can not understand it
            > >> totally. The following is its description:
            > >>
            > >> Nonbacktracking subexpression (also known as a "greedy"
            > >> subexpression). The subexpression is fully matched once, and then
            > >> does not participate piecemeal in backtracking. (That is, the
            > >> subexpression matches only strings that would be matched by the
            > >> subexpression alone.)
            > >>
            > >> Can anybody tell me how to use it? If someone knows, please show me
            > >> an example:) Thanks a lot!
            > >>
            > >> Best regards,
            > >> Laser Lu.[/color][/color]
            >
            >
            >
            >[/color]

            Comment

            • Laser Lu

              #7
              Re: About a Regular Expression Grouping Construct

              Hello Jakob,
              Actually I wan to know what does "(?> )" mean? :)
              [color=blue]
              > You can use the grouping construct for extracting parts of a string.
              > For example, say you want to extract the value of color (i.e. "red")
              > from the following string:
              >
              > string description color="red"
              >
              > You can do this using the regular expression: color="(?<color >\S*)"
              >
              > The following code uses the regular expression and the Match.Groups
              > property to print out the value "red":
              >
              > Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
              > Match m = rgx.Match("a string description color=\"red\"") ;
              > if (m.Success)
              > {
              > string color = m.Groups["color"].Value;
              > Console.WriteLi ne(color);
              > }
              > HTH, Jakob.
              >
              > "Laser Lu" wrote:
              >[color=green]
              >> Hello Daniel, thank you:)
              >> But I'd like to say that the RegularExpressi onValidator control is
              >> only available
              >> in ASP.NET Web Applications, and its built-in editor is simple. Both
              >> Regulator
              >> and Expresso are better than it.
              >> However, my question is what does the Grouping Construct '(?> )'
              >> mean? I just need a sample code on how to use this construct:)
              >>[color=darkred]
              >>> in the visual studio u can try the RegularExpressi onValidator and
              >>> there you can use your ExpString!
              >>>
              >>> "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
              >>> news:4878363249 5855093125000@n ews.microsoft.c om...
              >>>
              >>>> Hello, everybody,
              >>>> do you know how to use this Grouping Construct?
              >>>> (?> )
              >>>> I've found its reference on MSDN, but still can not understand it
              >>>> totally. The following is its description:
              >>>>
              >>>> Nonbacktracking subexpression (also known as a "greedy"
              >>>> subexpression). The subexpression is fully matched once, and then
              >>>> does not participate piecemeal in backtracking. (That is, the
              >>>> subexpression matches only strings that would be matched by the
              >>>> subexpression alone.)
              >>>>
              >>>> Can anybody tell me how to use it? If someone knows, please show me
              >>>> an example:) Thanks a lot!
              >>>>
              >>>> Best regards,
              >>>> Laser Lu.[/color][/color][/color]



              Comment

              • Jakob Christensen

                #8
                Re: About a Regular Expression Grouping Construct

                I am not sure I understand your question. "(?> )" defines af group. In my
                example I used "(?> )" to define a group called "color".

                Regards, Jakob.

                "Laser Lu" wrote:
                [color=blue]
                > Hello Jakob,
                > Actually I wan to know what does "(?> )" mean? :)
                >[color=green]
                > > You can use the grouping construct for extracting parts of a string.
                > > For example, say you want to extract the value of color (i.e. "red")
                > > from the following string:
                > >
                > > string description color="red"
                > >
                > > You can do this using the regular expression: color="(?<color >\S*)"
                > >
                > > The following code uses the regular expression and the Match.Groups
                > > property to print out the value "red":
                > >
                > > Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
                > > Match m = rgx.Match("a string description color=\"red\"") ;
                > > if (m.Success)
                > > {
                > > string color = m.Groups["color"].Value;
                > > Console.WriteLi ne(color);
                > > }
                > > HTH, Jakob.
                > >
                > > "Laser Lu" wrote:
                > >[color=darkred]
                > >> Hello Daniel, thank you:)
                > >> But I'd like to say that the RegularExpressi onValidator control is
                > >> only available
                > >> in ASP.NET Web Applications, and its built-in editor is simple. Both
                > >> Regulator
                > >> and Expresso are better than it.
                > >> However, my question is what does the Grouping Construct '(?> )'
                > >> mean? I just need a sample code on how to use this construct:)
                > >>
                > >>> in the visual studio u can try the RegularExpressi onValidator and
                > >>> there you can use your ExpString!
                > >>>
                > >>> "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
                > >>> news:4878363249 5855093125000@n ews.microsoft.c om...
                > >>>
                > >>>> Hello, everybody,
                > >>>> do you know how to use this Grouping Construct?
                > >>>> (?> )
                > >>>> I've found its reference on MSDN, but still can not understand it
                > >>>> totally. The following is its description:
                > >>>>
                > >>>> Nonbacktracking subexpression (also known as a "greedy"
                > >>>> subexpression). The subexpression is fully matched once, and then
                > >>>> does not participate piecemeal in backtracking. (That is, the
                > >>>> subexpression matches only strings that would be matched by the
                > >>>> subexpression alone.)
                > >>>>
                > >>>> Can anybody tell me how to use it? If someone knows, please show me
                > >>>> an example:) Thanks a lot!
                > >>>>
                > >>>> Best regards,
                > >>>> Laser Lu.[/color][/color]
                >
                >
                >
                >[/color]

                Comment

                • Jakob Christensen

                  #9
                  Re: About a Regular Expression Grouping Construct

                  I am not sure I understand your question. "(?> )" defines af group. In my
                  example I used "(?> )" to define a group called "color".

                  Regards, Jakob.

                  "Laser Lu" wrote:
                  [color=blue]
                  > Hello Jakob,
                  > Actually I wan to know what does "(?> )" mean? :)
                  >[color=green]
                  > > You can use the grouping construct for extracting parts of a string.
                  > > For example, say you want to extract the value of color (i.e. "red")
                  > > from the following string:
                  > >
                  > > string description color="red"
                  > >
                  > > You can do this using the regular expression: color="(?<color >\S*)"
                  > >
                  > > The following code uses the regular expression and the Match.Groups
                  > > property to print out the value "red":
                  > >
                  > > Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
                  > > Match m = rgx.Match("a string description color=\"red\"") ;
                  > > if (m.Success)
                  > > {
                  > > string color = m.Groups["color"].Value;
                  > > Console.WriteLi ne(color);
                  > > }
                  > > HTH, Jakob.
                  > >
                  > > "Laser Lu" wrote:
                  > >[color=darkred]
                  > >> Hello Daniel, thank you:)
                  > >> But I'd like to say that the RegularExpressi onValidator control is
                  > >> only available
                  > >> in ASP.NET Web Applications, and its built-in editor is simple. Both
                  > >> Regulator
                  > >> and Expresso are better than it.
                  > >> However, my question is what does the Grouping Construct '(?> )'
                  > >> mean? I just need a sample code on how to use this construct:)
                  > >>
                  > >>> in the visual studio u can try the RegularExpressi onValidator and
                  > >>> there you can use your ExpString!
                  > >>>
                  > >>> "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
                  > >>> news:4878363249 5855093125000@n ews.microsoft.c om...
                  > >>>
                  > >>>> Hello, everybody,
                  > >>>> do you know how to use this Grouping Construct?
                  > >>>> (?> )
                  > >>>> I've found its reference on MSDN, but still can not understand it
                  > >>>> totally. The following is its description:
                  > >>>>
                  > >>>> Nonbacktracking subexpression (also known as a "greedy"
                  > >>>> subexpression). The subexpression is fully matched once, and then
                  > >>>> does not participate piecemeal in backtracking. (That is, the
                  > >>>> subexpression matches only strings that would be matched by the
                  > >>>> subexpression alone.)
                  > >>>>
                  > >>>> Can anybody tell me how to use it? If someone knows, please show me
                  > >>>> an example:) Thanks a lot!
                  > >>>>
                  > >>>> Best regards,
                  > >>>> Laser Lu.[/color][/color]
                  >
                  >
                  >
                  >[/color]

                  Comment

                  • Laser Lu

                    #10
                    Re: About a Regular Expression Grouping Construct

                    Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not the
                    same:)
                    Please refer to

                    [color=blue]
                    > I am not sure I understand your question. "(?> )" defines af group.
                    > In my example I used "(?> )" to define a group called "color".
                    >
                    > Regards, Jakob.
                    >
                    > "Laser Lu" wrote:
                    >[color=green]
                    >> Hello Jakob,
                    >> Actually I wan to know what does "(?> )" mean? :)[color=darkred]
                    >>> You can use the grouping construct for extracting parts of a string.
                    >>> For example, say you want to extract the value of color (i.e. "red")
                    >>> from the following string:
                    >>>
                    >>> string description color="red"
                    >>>
                    >>> You can do this using the regular expression: color="(?<color >\S*)"
                    >>>
                    >>> The following code uses the regular expression and the Match.Groups
                    >>> property to print out the value "red":
                    >>>
                    >>> Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
                    >>> Match m = rgx.Match("a string description color=\"red\"") ;
                    >>> if (m.Success)
                    >>> {
                    >>> string color = m.Groups["color"].Value;
                    >>> Console.WriteLi ne(color);
                    >>> }
                    >>> HTH, Jakob.
                    >>> "Laser Lu" wrote:
                    >>>
                    >>>> Hello Daniel, thank you:)
                    >>>> But I'd like to say that the RegularExpressi onValidator control is
                    >>>> only available
                    >>>> in ASP.NET Web Applications, and its built-in editor is simple.
                    >>>> Both
                    >>>> Regulator
                    >>>> and Expresso are better than it.
                    >>>> However, my question is what does the Grouping Construct '(?> )'
                    >>>> mean? I just need a sample code on how to use this construct:)
                    >>>>> in the visual studio u can try the RegularExpressi onValidator and
                    >>>>> there you can use your ExpString!
                    >>>>>
                    >>>>> "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
                    >>>>> news:4878363249 5855093125000@n ews.microsoft.c om...
                    >>>>>
                    >>>>>> Hello, everybody,
                    >>>>>> do you know how to use this Grouping Construct?
                    >>>>>> (?> )
                    >>>>>> I've found its reference on MSDN, but still can not understand it
                    >>>>>> totally. The following is its description:
                    >>>>>> Nonbacktracking subexpression (also known as a "greedy"
                    >>>>>> subexpression). The subexpression is fully matched once, and then
                    >>>>>> does not participate piecemeal in backtracking. (That is, the
                    >>>>>> subexpression matches only strings that would be matched by the
                    >>>>>> subexpression alone.)
                    >>>>>>
                    >>>>>> Can anybody tell me how to use it? If someone knows, please show
                    >>>>>> me an example:) Thanks a lot!
                    >>>>>>
                    >>>>>> Best regards,
                    >>>>>> Laser Lu.[/color][/color][/color]



                    Comment

                    • Laser Lu

                      #11
                      Re: About a Regular Expression Grouping Construct

                      Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not the
                      same:)
                      Please refer to

                      [color=blue]
                      > I am not sure I understand your question. "(?> )" defines af group.
                      > In my example I used "(?> )" to define a group called "color".
                      >
                      > Regards, Jakob.
                      >
                      > "Laser Lu" wrote:
                      >[color=green]
                      >> Hello Jakob,
                      >> Actually I wan to know what does "(?> )" mean? :)[color=darkred]
                      >>> You can use the grouping construct for extracting parts of a string.
                      >>> For example, say you want to extract the value of color (i.e. "red")
                      >>> from the following string:
                      >>>
                      >>> string description color="red"
                      >>>
                      >>> You can do this using the regular expression: color="(?<color >\S*)"
                      >>>
                      >>> The following code uses the regular expression and the Match.Groups
                      >>> property to print out the value "red":
                      >>>
                      >>> Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
                      >>> Match m = rgx.Match("a string description color=\"red\"") ;
                      >>> if (m.Success)
                      >>> {
                      >>> string color = m.Groups["color"].Value;
                      >>> Console.WriteLi ne(color);
                      >>> }
                      >>> HTH, Jakob.
                      >>> "Laser Lu" wrote:
                      >>>
                      >>>> Hello Daniel, thank you:)
                      >>>> But I'd like to say that the RegularExpressi onValidator control is
                      >>>> only available
                      >>>> in ASP.NET Web Applications, and its built-in editor is simple.
                      >>>> Both
                      >>>> Regulator
                      >>>> and Expresso are better than it.
                      >>>> However, my question is what does the Grouping Construct '(?> )'
                      >>>> mean? I just need a sample code on how to use this construct:)
                      >>>>> in the visual studio u can try the RegularExpressi onValidator and
                      >>>>> there you can use your ExpString!
                      >>>>>
                      >>>>> "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
                      >>>>> news:4878363249 5855093125000@n ews.microsoft.c om...
                      >>>>>
                      >>>>>> Hello, everybody,
                      >>>>>> do you know how to use this Grouping Construct?
                      >>>>>> (?> )
                      >>>>>> I've found its reference on MSDN, but still can not understand it
                      >>>>>> totally. The following is its description:
                      >>>>>> Nonbacktracking subexpression (also known as a "greedy"
                      >>>>>> subexpression). The subexpression is fully matched once, and then
                      >>>>>> does not participate piecemeal in backtracking. (That is, the
                      >>>>>> subexpression matches only strings that would be matched by the
                      >>>>>> subexpression alone.)
                      >>>>>>
                      >>>>>> Can anybody tell me how to use it? If someone knows, please show
                      >>>>>> me an example:) Thanks a lot!
                      >>>>>>
                      >>>>>> Best regards,
                      >>>>>> Laser Lu.[/color][/color][/color]



                      Comment

                      • Jakob Christensen

                        #12
                        Re: About a Regular Expression Grouping Construct

                        Sorry, my bad :-) In that case I am afraid I don't know.

                        Regards, Jakob.


                        "Laser Lu" wrote:
                        [color=blue]
                        > Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not the
                        > same:)
                        > Please refer to
                        > http://msdn.microsoft.com/library/de...constructs.asp
                        >[color=green]
                        > > I am not sure I understand your question. "(?> )" defines af group.
                        > > In my example I used "(?> )" to define a group called "color".
                        > >
                        > > Regards, Jakob.
                        > >
                        > > "Laser Lu" wrote:
                        > >[color=darkred]
                        > >> Hello Jakob,
                        > >> Actually I wan to know what does "(?> )" mean? :)
                        > >>> You can use the grouping construct for extracting parts of a string.
                        > >>> For example, say you want to extract the value of color (i.e. "red")
                        > >>> from the following string:
                        > >>>
                        > >>> string description color="red"
                        > >>>
                        > >>> You can do this using the regular expression: color="(?<color >\S*)"
                        > >>>
                        > >>> The following code uses the regular expression and the Match.Groups
                        > >>> property to print out the value "red":
                        > >>>
                        > >>> Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
                        > >>> Match m = rgx.Match("a string description color=\"red\"") ;
                        > >>> if (m.Success)
                        > >>> {
                        > >>> string color = m.Groups["color"].Value;
                        > >>> Console.WriteLi ne(color);
                        > >>> }
                        > >>> HTH, Jakob.
                        > >>> "Laser Lu" wrote:
                        > >>>
                        > >>>> Hello Daniel, thank you:)
                        > >>>> But I'd like to say that the RegularExpressi onValidator control is
                        > >>>> only available
                        > >>>> in ASP.NET Web Applications, and its built-in editor is simple.
                        > >>>> Both
                        > >>>> Regulator
                        > >>>> and Expresso are better than it.
                        > >>>> However, my question is what does the Grouping Construct '(?> )'
                        > >>>> mean? I just need a sample code on how to use this construct:)
                        > >>>>> in the visual studio u can try the RegularExpressi onValidator and
                        > >>>>> there you can use your ExpString!
                        > >>>>>
                        > >>>>> "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
                        > >>>>> news:4878363249 5855093125000@n ews.microsoft.c om...
                        > >>>>>
                        > >>>>>> Hello, everybody,
                        > >>>>>> do you know how to use this Grouping Construct?
                        > >>>>>> (?> )
                        > >>>>>> I've found its reference on MSDN, but still can not understand it
                        > >>>>>> totally. The following is its description:
                        > >>>>>> Nonbacktracking subexpression (also known as a "greedy"
                        > >>>>>> subexpression). The subexpression is fully matched once, and then
                        > >>>>>> does not participate piecemeal in backtracking. (That is, the
                        > >>>>>> subexpression matches only strings that would be matched by the
                        > >>>>>> subexpression alone.)
                        > >>>>>>
                        > >>>>>> Can anybody tell me how to use it? If someone knows, please show
                        > >>>>>> me an example:) Thanks a lot!
                        > >>>>>>
                        > >>>>>> Best regards,
                        > >>>>>> Laser Lu.[/color][/color]
                        >
                        >
                        >
                        >[/color]

                        Comment

                        • Jakob Christensen

                          #13
                          Re: About a Regular Expression Grouping Construct

                          I found this: http://brl.sourceforge.net/brl_6.html#SEC67

                          It seems that the construct is not implemented by .net.

                          HTH, Jakob.

                          "Laser Lu" wrote:
                          [color=blue]
                          > Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not the
                          > same:)
                          > Please refer to
                          > http://msdn.microsoft.com/library/de...constructs.asp
                          >[color=green]
                          > > I am not sure I understand your question. "(?> )" defines af group.
                          > > In my example I used "(?> )" to define a group called "color".
                          > >
                          > > Regards, Jakob.
                          > >
                          > > "Laser Lu" wrote:
                          > >[color=darkred]
                          > >> Hello Jakob,
                          > >> Actually I wan to know what does "(?> )" mean? :)
                          > >>> You can use the grouping construct for extracting parts of a string.
                          > >>> For example, say you want to extract the value of color (i.e. "red")
                          > >>> from the following string:
                          > >>>
                          > >>> string description color="red"
                          > >>>
                          > >>> You can do this using the regular expression: color="(?<color >\S*)"
                          > >>>
                          > >>> The following code uses the regular expression and the Match.Groups
                          > >>> property to print out the value "red":
                          > >>>
                          > >>> Regex rgx = new Regex(@"color=\ ""(?<color>\S*) \""");
                          > >>> Match m = rgx.Match("a string description color=\"red\"") ;
                          > >>> if (m.Success)
                          > >>> {
                          > >>> string color = m.Groups["color"].Value;
                          > >>> Console.WriteLi ne(color);
                          > >>> }
                          > >>> HTH, Jakob.
                          > >>> "Laser Lu" wrote:
                          > >>>
                          > >>>> Hello Daniel, thank you:)
                          > >>>> But I'd like to say that the RegularExpressi onValidator control is
                          > >>>> only available
                          > >>>> in ASP.NET Web Applications, and its built-in editor is simple.
                          > >>>> Both
                          > >>>> Regulator
                          > >>>> and Expresso are better than it.
                          > >>>> However, my question is what does the Grouping Construct '(?> )'
                          > >>>> mean? I just need a sample code on how to use this construct:)
                          > >>>>> in the visual studio u can try the RegularExpressi onValidator and
                          > >>>>> there you can use your ExpString!
                          > >>>>>
                          > >>>>> "Laser Lu" <laser_lu@hotma il.com> escreveu na mensagem
                          > >>>>> news:4878363249 5855093125000@n ews.microsoft.c om...
                          > >>>>>
                          > >>>>>> Hello, everybody,
                          > >>>>>> do you know how to use this Grouping Construct?
                          > >>>>>> (?> )
                          > >>>>>> I've found its reference on MSDN, but still can not understand it
                          > >>>>>> totally. The following is its description:
                          > >>>>>> Nonbacktracking subexpression (also known as a "greedy"
                          > >>>>>> subexpression). The subexpression is fully matched once, and then
                          > >>>>>> does not participate piecemeal in backtracking. (That is, the
                          > >>>>>> subexpression matches only strings that would be matched by the
                          > >>>>>> subexpression alone.)
                          > >>>>>>
                          > >>>>>> Can anybody tell me how to use it? If someone knows, please show
                          > >>>>>> me an example:) Thanks a lot!
                          > >>>>>>
                          > >>>>>> Best regards,
                          > >>>>>> Laser Lu.[/color][/color]
                          >
                          >
                          >
                          >[/color]

                          Comment

                          Working...