C#
Файл Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
/*
string result = "";
// string strName = ";1Vol12_Привет__wAgen";
string strName = "Привет";
Console.WriteLine(strName);
string[] splited = strName.Split(';', '_', '"');
for (int i = 0; i < splited.Length; i++)
{
string word = splited[i];
for (int j = 0; j < word.Length; j++)
{
char symbol = word[j];
if (Char.IsLetter(symbol))
{
result += symbol;
break;
}
}
}
*/
string input = ";1Vol12;Привет__wAgen";
string pattern = @"([_]|[;])[0-9A-Za-z]+";
Console.WriteLine(input);
foreach (Match match in Regex.Matches(input, pattern, RegexOptions.IgnoreCase))
{
// Console.WriteLine("{0}", match.Value);
string word = match.Value;
Regex regexWord = new Regex(@"[A-Za-z]{1}");
Match match2 = regexWord.Match(word);
if (match.Success)
Console.WriteLine(match2.Value);
}
}
}
}