2
문자열에있는 세 개의 연속 문자 (영숫자 문자)와 일치하는 정규 표현식이 필요합니다. 2a82a9e4eee646448db00e3fccabd8c7이 "EEE"일치하는 것N 연속 문자에 대한 .NET 정규 표현식
.
것은 2a82a9e4efe64644448db00e3fccabd8c7 "444"일치 될 경우.
등
문자열에있는 세 개의 연속 문자 (영숫자 문자)와 일치하는 정규 표현식이 필요합니다. 2a82a9e4eee646448db00e3fccabd8c7이 "EEE"일치하는 것N 연속 문자에 대한 .NET 정규 표현식
.
것은 2a82a9e4efe64644448db00e3fccabd8c7 "444"일치 될 경우.
등
사용 역 참조.
([a-zA-Z0-9])\1\1
이 시도 :
using System;
using System.Text.RegularExpressions;
class MainClass {
private static void DisplayMatches(string text,
string regularExpressionString)
{
Console.WriteLine("using the following regular expression: "
+regularExpressionString);
MatchCollection myMatchCollection =
Regex.Matches(text, regularExpressionString);
foreach (Match myMatch in myMatchCollection) {
Console.WriteLine(myMatch);
}
}
public static void Main()
{
string text ="Missisipli Kerrisdale she";
Console.WriteLine("Matching words that that contain "
+ "two consecutive identical characters");
DisplayMatches(text, @"\S*(.)\1\S*");
}
}
@ 크리스 : C#을 정규 표현식이 없습니다. –
@ 존 : 정말요? http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.aspx –
나중에 참조 할 수 있도록 John의 주석은 게시일의 컨텍스트에서 읽어야합니다. – harpo