4
votes
8answers
2k views

Regex accent insensitive?

I need a Regex in a C# program. I've to capture a name of a file with a specific structure. I used the \w char class, but the problem is that this class doesn't match any accented char. Then how ...
-5
votes
2answers
47 views

Multiline Regular Expression (Regex) with C# [closed]

I've been trying to do this for some time, this is a part of text, and I want to get some values from it, to be exact: <td align="Left"> <a href="randomUrl">Something</a> //Need ...
3
votes
0answers
20 views

Best way to process non-standard quotes in XML parser

I am creating a program that process text with XML formatting. I found that when the tag values are non-ASCII quotes (double quotes / ASCII 34, single quote / ASCII 39) the parsing throws exception. ...
25
votes
7answers
57k views

c# regex email validation

I use this @"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$" regexp to validate the email ([\w\.\-]+) - this is for the first-level domain (many letters and numbers, also point and hyphen) ([\w\-]+) - ...
1
vote
3answers
25 views

Regex to Split obj.method(obj.attr, obj.attr2)

I'm looking for a regex to split this kind of content : obj.method(obj.attr,obj.attr2) And I want the split to return an array : ["obj", "method(obj.attr, obj.attr2)"] So, I can't split on "." ...
3
votes
1answer
37 views

Parse or Convert TimeSpan to string

I need to parse a TimeSpan to a string using a user provided format I've tried a number of options including various RegEx.Replace and Parse options. In the below I've added an Extension method to ...
3
votes
2answers
39 views

Regular Expression IsMatch() method in C#

I compiled the code: namespace TestRegExp { class Program { static void Main(string[] args) { if (Regex.IsMatch(args[1], args[0])) ...
0
votes
1answer
39 views

Validate a string's format like a phone number?

I'm a newbie in C#..I'm writing a console application that accepts data, I want to validate the data such that it must be entered in a particular format e.g Phone number must be entered in format ' ...
7
votes
1answer
89 views

What are regular expression Balancing Groups?

I was just reading a question about how to get data inside double curly braces (this question), and then someone brought up balancing groups. I'm still not quite sure what they are and how to use ...
2
votes
2answers
73 views

Match text surrounded by “{{” and “}}”

I'm looking for a Regex which can do this : My text : "Blablabla {{ blabla1 }} blablablabla {{ blablabla2 {{ blabla3 }} }} blablabla" What I want to extract : "blabla1" and "blablabla2 {{ blabla3 ...
2
votes
0answers
179 views

Compare two string using Regex

I am using two string for a matching program like this: string s1= 5-4-6-+1-+1+1+3000+12+21-+1-+1-+1-+2-3-4-5-+1-+10+1-+1-+; string s2= 6-+1-+1+1+3000+12+21-+1-+1-+1-+1-+1-+1+1-+1-+; as ...
2
votes
7answers
49 views

Best Regex for my Purpose

All, I have the following list of strings List<string> list = new List<string>() { "Japanese (Japan) (ja-jp)", "Scottish Gaelic (United Kingdom) (gd-gb)", "German (Germany) ...
0
votes
2answers
37 views

Generating regular expression using a set of regular expressions [duplicate]

I am working on a regular expression that matches the postal codes of a set of countries. Since getting a regex that matches the postal code for any one country is relatively easy, I plan to parse all ...
0
votes
3answers
50 views

Understanding why Regex not matching

I got a regex that is not matching in C#. string auth = @"oauth_consumer_key=""0685bd9184jfhq22"""; string pattern = "oauth_consumer_key=\"(\\d+)%"; MatchCollection matches = Regex.Matches(auth, ...
2
votes
1answer
49 views

Regex.Replace behaving oddly

I have a series of strings that I need to de-tokenize. The strings come from a database and look something like this Subject: Ticket ##TicketID## Created ShortText: Ticket ##TicketName## created (ID: ...

1 2 3 4 5 414
15 30 50 per page