matchcollection

Regex - Using Groups and MatchCollection - Problems

Hello, I try to keep it brief and concise. I have to write a program that takes queries in SQL form and searches an XML. Right now I am trying to disassemble a string into logical pieces so I can work with them. I have a string as input and want to get a MatchCollection as output. Please not that the test string below is of a special f...

Regular Expression to find all Email Matches help for C# application

I have an application where I need to parse a string to find all the e-mail addresses in a that string. I am not a regular espression guru by any means and not sure what the differnce is between some expressions. I have found 2 expressions that, apprently, will match all of the e-mail addresses in a string. I cannot get either to work in...

Efficiently Combine MatchCollections in .Net Regex

In the simplified example, there are 2 Regular Expressions, one case sensitive, the other not. The idea would be to efficiently create an IEnumerable collection (see "combined" below) combining the results. string test = "abcABC"; string regex = "(?<grpa>a)|(?<grpb>b)|(?<grpc>c)]"; Regex regNoCase = new Regex(regex, RegexOptions.Ignore...

What is the preferred way to filter a regex search for duplicate matches in C#

A new question has arisen in relation to an earlier question of mine. I have some code that is using a regex to find email addresses. It's working great except that it returns duplicate matches. I searched this site and found a question from a long time ago that was dealing with a similar problem, and the answer had something to do with ...