473,621 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

Nov 17 '05 #1
12 2657
in the visual studio u can try the RegularExpressi onValidator and there you
can use your ExpString!

"Laser Lu" <la******@hotma il.com> escreveu na mensagem
news:48******** *************@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.

Nov 17 '05 #2
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" <la******@hotma il.com> escreveu na mensagem
news:48******** *************@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.


Nov 17 '05 #3
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" <la******@hotma il.com> escreveu na mensagem
news:48******** *************@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.


Nov 17 '05 #4
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" <la******@hotma il.com> escreveu na mensagem
news:48******** *************@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.


Nov 17 '05 #5
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" <la******@hotma il.com> escreveu na mensagem
news:48******** *************@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.


Nov 17 '05 #6
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" <la******@hotma il.com> escreveu na mensagem
news:48******** *************@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.


Nov 17 '05 #7
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:
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" <la******@hotma il.com> escreveu na mensagem
news:48******** *************@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.


Nov 17 '05 #8
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:
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" <la******@hotma il.com> escreveu na mensagem
news:48******** *************@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.


Nov 17 '05 #9
Hey Jakob, you used construct "(?<name> )", not "(?> )". They are not the
same:)
Please refer to
http://msdn.microsoft.com/library/de...constructs.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" wrote:
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" <la******@hotma il.com> escreveu na mensagem
> news:48******** *************@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.


Nov 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3382
by: Ahmad A. Rahman | last post by:
Hi all, I have a problem constructing a regular expression using .net. I have a string, separated with comma, and I want to group the string together but, I failed to group a numeric character with decimal values. Example string : 1, 2.3, "two"," three" So, I want to group this string into 4 groups (1), (2.3), (two) and (three)
0
985
by: Laser Lu | last post by:
Hi, all, Does any body know how to use this Grouping Construct? (?> ) The following is its description in the MSDN reference: 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
2
5040
by: Sehboo | last post by:
Hi, I have several regular expressions that I need to run against documents. Is it possible to combine several expressions in one expression in Regex object. So that it is faster, or will I have to use all the expressions seperately? Here are my regular expressions that check for valid email address and link Dim Expression As String =
7
3815
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I want to avoid that. My question here is if there is a way to pass either a memory stream or array of "find", "replace" expressions or any other way to avoid multiple copies of a string. Any help will be highly appreciated
5
2278
by: Cylix | last post by:
I am going to write a function that the search engine done. in search engine, we may using double quotation to specify a pharse like "I love you", How can I using regular expression to sperate each pharse? test case: "I love" all "of you" I would like it return:
8
1885
by: sri_san | last post by:
Hello, I am trying to write a regular expresssion which validates against the URL and the textfield has 'http://' prefilled. I either want a valid URL or just leave the 'http://' as it is. I figured an expression for URL which is --- "http(s)?://(+\.)++(/*)?" I am unable to group it based on the above condition. Any help would be great! Thanks, Sam.
16
9347
by: Mark Rae | last post by:
Hi, Supposing I had a string made up of a person's name followed by their profession in parentheses e.g. string strText = "Tiger Woods (golfer)"; and I wanted to extract the portion of the string between the parentheses i.e. "golfer"
3
2746
by: Zeba | last post by:
Hi guys, I need some help regarding regular expressions. Consider the following statement : System.Text.RegularExpressions.Match match = System.Text.RegularExpressions.Regex.Match(requestPath, "(*?\ \.ashx)"); (where requestPath is a string)
5
8261
by: Noah Hoffman | last post by:
I have been trying to write a regular expression that identifies a block of text enclosed by (potentially nested) parentheses. I've found solutions using other regular expression engines (for example, my text editor, BBEdit, which uses the PCRE library), but have not been able to replicate it using python's re module. Here's a version that works using the PCRE syntax, along with the python error message. I'm hoping for this to identify...
0
8213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8156
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8597
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8306
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5554
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4065
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2587
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.