سلام بر برنامه نویسان عزیز 😉 در این مطلب کد تطبیق دادن white-space با Regex در سی شارپ را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
کد تطبیق دادن white-space با Regex در سی شارپ :
using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"gr[ae]y\s\S+?[\s|\p{P}]";
string input = "this is a test.";
MatchCollection matches = Regex.Matches(input, pattern);
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"gr[ae]y\s\S+?[\s|\p{P}]";
string input = "this is a test.";
MatchCollection matches = Regex.Matches(input, pattern);