c# - regex exclude match from capture -


Use Regex in the net

I will have a set of data that is something like this Comes

  & lt; Bunch o 'data here & gt;  

Where & lt; is the only indicator of a new record and & gt; is the end of the record.

These records may come in this way

  & lt; Dataset 1 & gt; & Lt; Dataset to broken, a closing tag & lt; Dataset 3 & gt;  

They also

  & lt; Dataset 1 & gt; Dataset 2 broken, any opening tag & gt; & Lt; Dataset 3 & gt;  

However, I am not sure that this latter matter is possible, and I will cross that bridge when I have to do

I will start with this beginning and end To record the use of Reggae on the basis of character, at the end, something like

  Mail 1 = & lt; Dataset 1 & gt; Match2 = & lt; Dataset to broken, no closing tag match 3 = & lt; Dataset 3 & gt;  

I am trying to explain how non-captive groups work and maybe my understanding is wrong.

  & lt ;. *? (?: & Lt; | & gt;)  

I feel very close to me, except that it involves the initial character of the third set of data, with the possession of the second group I also suspect that ?: is not doing what it needs to do and if it takes it out, then it gives the same set of match (2)

It seems that you have flipped it? You can not capture ?: For, :? .

  & lt ;. *? (?: Want to use? & Lt; | & gt;)  

To make a little detail: within a capture group? The operator means that you want to do something special, a : means that it is not captured, but there are other actions that do you do to ? Mango people are back and forth (? = ) and back and backward (? & Lt; ), but many others are

I also realize the realm of what you are trying to match (beyond the non-capturing issue), the language of the matching feet / cells / etc. is not regularly, so assume that I am right I understand your purpose in the way - to match what you want, you will need to create a much more extended regular expression. There are some other questions about this, in which there are some discussions about it.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -