Answers for "regex currency symbols"

C#
0

regex currency symbols

using System;
using System.Text.RegularExpressions;

Console.OutputEncoding = System.Text.Encoding.UTF8;

string content = @"Currency symbols: ฿ Thailand bath, ₹  Indian rupee, 
    ₾ Georgian lari, $ Dollar, € Euro, ¥ Yen, £ Pound Sterling";

string pattern = @"\p{Sc}";

var rx = new Regex(pattern, RegexOptions.Compiled);
var matches = rx.Matches(content);

foreach (Match match in matches)
{
    Console.WriteLine($"{match.Value} is at {match.Index}");
}
Posted by: Guest on October-13-2021

Code answers related to "regex currency symbols"

C# Answers by Framework

Browse Popular Code Answers by Language