About a Regular Expression Grouping Construct

  • Thread starter Thread starter Laser Lu
  • Start date Start date
L

Laser Lu

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.
 
in the visual studio u can try the RegularExpressionValidator and there you
can use your ExpString!
 
Hello Daniel, thank you:)
But I'd like to say that the RegularExpressionValidator 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:)
 
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.WriteLine(color);
}

HTH, Jakob.
 
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.WriteLine(color);
}
HTH, Jakob.

Laser Lu said:
Hello Daniel, thank you:)
But I'd like to say that the RegularExpressionValidator 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:)
 
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 said:
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.WriteLine(color);
}
HTH, Jakob.

Laser Lu said:
Hello Daniel, thank you:)
But I'd like to say that the RegularExpressionValidator 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 RegularExpressionValidator and
there you can use your ExpString!

"Laser Lu" <[email protected]> escreveu na mensagem

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.
 
Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not the
same:)
Please refer to
http://msdn.microsoft.com/library/d...-us/cpgenref/html/cpcongroupingconstructs.asp
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 said:
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.WriteLine(color);
}
HTH, Jakob.
:

Hello Daniel, thank you:)
But I'd like to say that the RegularExpressionValidator 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 RegularExpressionValidator and
there you can use your ExpString!

"Laser Lu" <[email protected]> escreveu na mensagem

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.
 
Sorry, my bad :-) In that case I am afraid I don't know.

Regards, Jakob.


Laser Lu said:
Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not the
same:)
Please refer to
http://msdn.microsoft.com/library/d...-us/cpgenref/html/cpcongroupingconstructs.asp
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 said:
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.WriteLine(color);
}
HTH, Jakob.
:

Hello Daniel, thank you:)
But I'd like to say that the RegularExpressionValidator 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 RegularExpressionValidator and
there you can use your ExpString!

"Laser Lu" <[email protected]> escreveu na mensagem

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.
 
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 said:
Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not the
same:)
Please refer to
http://msdn.microsoft.com/library/d...-us/cpgenref/html/cpcongroupingconstructs.asp
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 said:
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.WriteLine(color);
}
HTH, Jakob.
:

Hello Daniel, thank you:)
But I'd like to say that the RegularExpressionValidator 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 RegularExpressionValidator and
there you can use your ExpString!

"Laser Lu" <[email protected]> escreveu na mensagem

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.
 
Hi, Jakob, Thank you very much!
It doesn't matter whether it is implemented by .NET. The key point is whether
it conforms to the Regular Expression Standard:)
Actually the .net implementation of regular expression is compatible with
Perl 5.
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 said:
Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not
the

same:)

Please refer to

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpge
nref/html/cpcongroupingconstructs.asp
I am not sure I understand your question. "(?> )" defines af group.
In my example I used "(?> )" to define a group called "color".

Regards, Jakob.

:

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.WriteLine(color);
}
HTH, Jakob.
:
Hello Daniel, thank you:)
But I'd like to say that the RegularExpressionValidator 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 RegularExpressionValidator
and there you can use your ExpString!

"Laser Lu" <[email protected]> escreveu na mensagem

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.
 
Back
Top