Click here to Skip to main content
15,867,141 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: implementing the mvc-pattern Pin
Josh Smith27-Apr-06 7:39
Josh Smith27-Apr-06 7:39 
GeneralRe: implementing the mvc-pattern Pin
CWIZO27-Apr-06 7:40
CWIZO27-Apr-06 7:40 
GeneralRe: implementing the mvc-pattern Pin
thebread27-Apr-06 10:03
thebread27-Apr-06 10:03 
GeneralRe: implementing the mvc-pattern Pin
Josh Smith27-Apr-06 13:20
Josh Smith27-Apr-06 13:20 
Questionexception handling Pin
D.N.26-Apr-06 19:26
D.N.26-Apr-06 19:26 
AnswerRe: exception handling Pin
CWIZO27-Apr-06 5:47
CWIZO27-Apr-06 5:47 
AnswerRe: exception handling Pin
Josh Smith27-Apr-06 7:25
Josh Smith27-Apr-06 7:25 
QuestionRegex.Split and sub groups Pin
Distinctive26-Apr-06 17:15
Distinctive26-Apr-06 17:15 
I have a regular expression that I use to find html tags in a string, the expression is similar to the following:

<(?<TagName>[a-zA-Z\d]{1,})(\s[a-zA-Z\d]{1,}="[\s\w]{0,}"){0,}(\s/>|\s?>.*?</\k<TagName>>)

It's designed to detect html tags such as the following:
<strong /> OR <strong>Text</strong> OR <strong ID="supertext">Text</strong>

What I'd like to do is use this expression to split a file into an array of strings but I get odd results when I use the Regex.Split() method.

Lets say I want to split the following line of text:
The <em>quick</em> brown fox jumps over the <strong>lazy</strong> dog.<br />

Regex.Split() produces the following array:
1 - The
2 - <em>quick</em>
3 - >quick</em>
4 - em
5 - brown fox jumps over the
6 - <strong>lazy</strong>
7 - >lazy</strong>
8 - strong
9 - dog.
10 - <br />
11 - />
12 - br

It's obviously splitting on the sub groups as well as the entire tag.

Is there any way I can tell the regex engine to only split 1 group, not them all?

As you can see the solution isn't as simple as just removing the extra groupings because they are needed so that I can detect the close of an open tag, and allow more than one property to be in each html tag.

Thanks in advance for any help
AnswerRe: Regex.Split and sub groups Pin
Guffa26-Apr-06 21:27
Guffa26-Apr-06 21:27 
GeneralRe: Regex.Split and sub groups Pin
Distinctive26-Apr-06 23:06
Distinctive26-Apr-06 23:06 
AnswerRe: Regex.Split and sub groups Pin
Guffa27-Apr-06 0:17
Guffa27-Apr-06 0:17 
QuestionClick Once Deployment & logging Pin
Mr Brown Shoes25-Apr-06 14:41
Mr Brown Shoes25-Apr-06 14:41 
AnswerRe: Click Once Deployment & logging Pin
JimRoss2-May-06 11:38
JimRoss2-May-06 11:38 
GeneralRe: Click Once Deployment & logging Pin
Tailslide5-Nov-09 6:11
Tailslide5-Nov-09 6:11 
QuestionDataGridView.remove how do i call this , help ? Pin
Steve Ryan25-Apr-06 12:01
Steve Ryan25-Apr-06 12:01 
AnswerRe: DataGridView.remove how do i call this , help ? Pin
Mr Brown Shoes25-Apr-06 14:53
Mr Brown Shoes25-Apr-06 14:53 
AnswerRe: DataGridView.remove how do i call this , help ? Pin
Graham Nimbley25-Apr-06 15:10
Graham Nimbley25-Apr-06 15:10 
GeneralRe: DataGridView.remove how do i call this , help ? Pin
Steve Ryan26-Apr-06 14:57
Steve Ryan26-Apr-06 14:57 
GeneralRe: DataGridView.removeat failed, any one help ? Pin
Steve Ryan26-Apr-06 17:48
Steve Ryan26-Apr-06 17:48 
QuestionMSI Setup always brings back original files... Pin
siliconesoul25-Apr-06 4:04
siliconesoul25-Apr-06 4:04 
QuestionFor minimizing and maximizing Pin
Robert Rohde25-Apr-06 2:49
Robert Rohde25-Apr-06 2:49 
AnswerRe: For minimizing and maximizing Pin
_alank25-Apr-06 3:04
_alank25-Apr-06 3:04 
GeneralRe: For minimizing and maximizing Pin
Robert Rohde25-Apr-06 3:18
Robert Rohde25-Apr-06 3:18 
AnswerRe: For minimizing and maximizing Pin
Graham Nimbley25-Apr-06 13:30
Graham Nimbley25-Apr-06 13:30 
GeneralRe: For minimizing and maximizing Pin
Robert Rohde25-Apr-06 18:02
Robert Rohde25-Apr-06 18:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.